Skip to content

Commit

Permalink
feat: ♿️ Typebot header back to folder if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 28, 2022
1 parent c5b378d commit cb51e6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
20 changes: 9 additions & 11 deletions apps/builder/components/dashboard/FolderContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,15 @@ export const FolderContent = ({ folder }: Props) => {
},
})

const { totalSharedTypebots, isLoading: isSharedTypebotsCountLoading } =
useSharedTypebotsCount({
userId: folder === null ? user?.id : undefined,
onError: (error) => {
toast({
title: "Couldn't fetch shared typebots",
description: error.message,
})
},
})
const { totalSharedTypebots } = useSharedTypebotsCount({
userId: folder === null ? user?.id : undefined,
onError: (error) => {
toast({
title: "Couldn't fetch shared typebots",
description: error.message,
})
},
})

useEffect(() => {
if (
Expand Down Expand Up @@ -197,7 +196,6 @@ export const FolderContent = ({ folder }: Props) => {
folderId={folder?.id}
isLoading={isTypebotLoading}
/>
{isSharedTypebotsCountLoading && <ButtonSkeleton />}
{totalSharedTypebots > 0 && <SharedTypebotsButton />}
{isFolderLoading && <ButtonSkeleton />}
{folders &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ export const TypebotHeader = () => {
as={NextChakraLink}
aria-label="Back"
icon={<ChevronLeftIcon fontSize={30} />}
href="/typebots"
href={
typebot?.folderId
? `/typebots/folders/${typebot.folderId}`
: '/typebots'
}
/>
{typebot?.name && (
<EditableTypebotName
Expand Down

0 comments on commit cb51e6b

Please sign in to comment.