Skip to content

Commit

Permalink
revert TagBookmarkButton (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojj1123 committed Mar 9, 2024
1 parent c467d3f commit 1fc77d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/features/explore/tags/components/TagBookmarkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ const TAG_DELAY = 1500;
export const TagBookmarkButton = ({ tagId }: Props) => {
const { show, close } = useToast();
const { validate, isLoading } = useAuth();
const { data: tagInfo } = useGetTagInfo(tagId, { enabled: !isLoading });
const { data: tagInfo, isFetchedAfterMount } = useGetTagInfo(tagId, { enabled: !isLoading });

const { mutate: saveMutation } = usePostFavoriteTag();
const { mutate: deleteMutation, onCancel } = useDeleteFavoriteTag(TAG_DELAY);
const [, setIsOpenTagCategory] = useTagCategoryContext();

if (!isFetchedAfterMount || !tagInfo) {
return null;
}

const handleSaveBookmark = () => {
saveMutation(
{ tagId: tagId, name: tagInfo.name },
Expand Down

0 comments on commit 1fc77d6

Please sign in to comment.