|
@@ -24,7 +24,7 @@ import {
|
|
|
OnDuplicatedFunction, OnRenamedFunction, OnDeletedFunction, OnPutBackedFunction,
|
|
OnDuplicatedFunction, OnRenamedFunction, OnDeletedFunction, OnPutBackedFunction,
|
|
|
} from '~/interfaces/ui';
|
|
} from '~/interfaces/ui';
|
|
|
import LinkedPagePath from '~/models/linked-page-path';
|
|
import LinkedPagePath from '~/models/linked-page-path';
|
|
|
-import { useSWRBookmarkInfo, useSWRxCurrentUserBookmarks } from '~/stores/bookmark';
|
|
|
|
|
|
|
+import { useSWRBookmarkInfo, useSWRxUserBookmarks } from '~/stores/bookmark';
|
|
|
import {
|
|
import {
|
|
|
usePageRenameModal, usePageDuplicateModal, usePageDeleteModal, usePutBackPageModal,
|
|
usePageRenameModal, usePageDuplicateModal, usePageDeleteModal, usePutBackPageModal,
|
|
|
} from '~/stores/modal';
|
|
} from '~/stores/modal';
|
|
@@ -90,7 +90,7 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
|
|
|
|
|
|
|
|
const shouldFetch = isSelected && (pageData != null || pageMeta != null);
|
|
const shouldFetch = isSelected && (pageData != null || pageMeta != null);
|
|
|
const { data: pageInfo } = useSWRxPageInfo(shouldFetch ? pageData?._id : null);
|
|
const { data: pageInfo } = useSWRxPageInfo(shouldFetch ? pageData?._id : null);
|
|
|
- const { mutate: mutateCurrentUserBookmark } = useSWRxCurrentUserBookmarks();
|
|
|
|
|
|
|
+ const { mutate: mutateUserBookmark } = useSWRxUserBookmarks();
|
|
|
const { mutate: mutateBookmarkInfo } = useSWRBookmarkInfo(pageData?._id);
|
|
const { mutate: mutateBookmarkInfo } = useSWRBookmarkInfo(pageData?._id);
|
|
|
const elasticSearchResult = isIPageSearchMeta(pageMeta) ? pageMeta.elasticSearchResult : null;
|
|
const elasticSearchResult = isIPageSearchMeta(pageMeta) ? pageMeta.elasticSearchResult : null;
|
|
|
const revisionShortBody = isIPageInfoForListing(pageMeta) ? pageMeta.revisionShortBody : null;
|
|
const revisionShortBody = isIPageInfoForListing(pageMeta) ? pageMeta.revisionShortBody : null;
|
|
@@ -128,7 +128,7 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
|
|
|
const bookmarkMenuItemClickHandler = async(_pageId: string, _newValue: boolean): Promise<void> => {
|
|
const bookmarkMenuItemClickHandler = async(_pageId: string, _newValue: boolean): Promise<void> => {
|
|
|
const bookmarkOperation = _newValue ? bookmark : unbookmark;
|
|
const bookmarkOperation = _newValue ? bookmark : unbookmark;
|
|
|
await bookmarkOperation(_pageId);
|
|
await bookmarkOperation(_pageId);
|
|
|
- mutateCurrentUserBookmark();
|
|
|
|
|
|
|
+ mutateUserBookmark();
|
|
|
mutateBookmarkInfo();
|
|
mutateBookmarkInfo();
|
|
|
};
|
|
};
|
|
|
|
|
|