mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix: effect deps (#1940)
This commit is contained in:
@@ -43,6 +43,6 @@ export function useBlockSuiteWorkspaceAvatarUrl(
|
||||
dispose.dispose();
|
||||
};
|
||||
}
|
||||
}, []);
|
||||
}, [blockSuiteWorkspace]);
|
||||
return [avatar ?? null, setAvatar] as const;
|
||||
}
|
||||
|
||||
@@ -13,12 +13,15 @@ export function useBlockSuiteWorkspacePageIsPublic(page: Page) {
|
||||
page.workspace.meta.pageMetasUpdated.on(() => {
|
||||
set(page.meta.isPublic ?? false);
|
||||
});
|
||||
}, []);
|
||||
const setIsPublic = useCallback((isPublic: boolean) => {
|
||||
set(isPublic);
|
||||
page.workspace.setPageMeta(page.id, {
|
||||
isPublic,
|
||||
});
|
||||
}, []);
|
||||
}, [page]);
|
||||
const setIsPublic = useCallback(
|
||||
(isPublic: boolean) => {
|
||||
set(isPublic);
|
||||
page.workspace.setPageMeta(page.id, {
|
||||
isPublic,
|
||||
});
|
||||
},
|
||||
[page.id, page.workspace]
|
||||
);
|
||||
return [isPublic, setIsPublic] as const;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user