mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +08:00
chore: fix most warnings and ignore a few warnings, because the code quality is too bad
This commit is contained in:
@@ -9,7 +9,7 @@ export const useCurrentPageMeta = (): PageMeta | null => {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
(currentWorkspace?.meta.pageMetas.find(
|
||||
(currentWorkspace.meta.pageMetas.find(
|
||||
p => p.id === currentPage.pageId
|
||||
) as PageMeta) ?? null
|
||||
);
|
||||
@@ -22,7 +22,7 @@ export const useCurrentPageMeta = (): PageMeta | null => {
|
||||
useEffect(() => {
|
||||
setCurrentPageMeta(pageMetaHandler);
|
||||
|
||||
const dispose = currentWorkspace?.meta.pagesUpdated.on(res => {
|
||||
const dispose = currentWorkspace?.meta.pagesUpdated.on(() => {
|
||||
setCurrentPageMeta(pageMetaHandler);
|
||||
}).dispose;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export const useInitWorkspace = (disabled?: boolean) => {
|
||||
loadWorkspace(workspaceId).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
}, [workspaceId, disabled]);
|
||||
}, [workspaceId, disabled, loadWorkspace]);
|
||||
|
||||
return {
|
||||
workspaceId,
|
||||
|
||||
@@ -59,6 +59,7 @@ export const usePageHelper = (): EditorHandlers => {
|
||||
return trash;
|
||||
},
|
||||
search: (query: QueryContent) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
return currentWorkspace!.search(query);
|
||||
},
|
||||
changePageMode: async (pageId, mode) => {
|
||||
@@ -76,6 +77,7 @@ export const usePageHelper = (): EditorHandlers => {
|
||||
},
|
||||
permanentlyDeletePage: pageId => {
|
||||
// TODO: workspace.meta.removePage or workspace.removePage?
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
currentWorkspace!.meta.removePage(pageId);
|
||||
},
|
||||
openPage: (pageId, query = {}, newTab = false) => {
|
||||
|
||||
Reference in New Issue
Block a user