mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 15:11:37 +03:00
fix: effect deps (#1940)
This commit is contained in:
parent
d58f9db289
commit
5ca94db5d2
@ -4,3 +4,4 @@ dist
|
||||
out
|
||||
storybook-static
|
||||
affine-out
|
||||
_next
|
||||
|
@ -10,6 +10,7 @@ module.exports = {
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:react-hooks/recommended',
|
||||
'plugin:react/recommended',
|
||||
'plugin:react/jsx-runtime',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
|
@ -58,6 +58,7 @@
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.32.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"fake-indexeddb": "4.0.1",
|
||||
|
@ -50,7 +50,7 @@ const BlockSuiteEditorImpl = (props: EditorProps): ReactElement => {
|
||||
}
|
||||
props.onLoad?.(page, editor);
|
||||
}
|
||||
}, [props.page, props.onInit, props.onLoad]);
|
||||
}, [props.page, props.onInit, props.onLoad, editor, props, page]);
|
||||
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
|
||||
|
@ -53,10 +53,10 @@ export const AffineSharePage: FC<ShareMenuProps> = props => {
|
||||
}, [props.workspace.id, props.currentPage.id]);
|
||||
const onClickCreateLink = useCallback(() => {
|
||||
setIsPublic(true);
|
||||
}, [isPublic]);
|
||||
}, [setIsPublic]);
|
||||
const onClickCopyLink = useCallback(() => {
|
||||
navigator.clipboard.writeText(sharingUrl);
|
||||
}, []);
|
||||
}, [sharingUrl]);
|
||||
|
||||
return (
|
||||
<div className={menuItemStyle}>
|
||||
|
@ -32,7 +32,7 @@ export const PublicLinkDisableModal = ({
|
||||
portal: document.body,
|
||||
});
|
||||
onClose();
|
||||
}, []);
|
||||
}, [onClose, setIsPublic]);
|
||||
return (
|
||||
<Modal open={open} onClose={onClose}>
|
||||
<StyledModalWrapper>
|
||||
|
@ -78,7 +78,7 @@ const TreeNodeItemWithDnd = <RenderProps,>({
|
||||
if (isOver && canDrop) {
|
||||
setCollapsed(node.id, false);
|
||||
}
|
||||
}, [isOver, canDrop]);
|
||||
}, [isOver, canDrop, setCollapsed, node.id]);
|
||||
|
||||
return (
|
||||
<TreeNodeItem
|
||||
|
@ -60,7 +60,7 @@ export const TreeView = <RenderProps,>({
|
||||
document.removeEventListener('keydown', handleDirectionKeyDown);
|
||||
document.removeEventListener('keydown', handleEnterKeyDown);
|
||||
};
|
||||
}, [data, selectedId]);
|
||||
}, [data, enableKeyboardSelection, onSelect, selectedId]);
|
||||
|
||||
const setCollapsed: TreeNodeProps['setCollapsed'] = (id, collapsed) => {
|
||||
if (disableCollapse) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -7426,6 +7426,7 @@ __metadata:
|
||||
eslint-plugin-import: ^2.27.5
|
||||
eslint-plugin-prettier: ^4.2.1
|
||||
eslint-plugin-react: ^7.32.2
|
||||
eslint-plugin-react-hooks: ^4.6.0
|
||||
eslint-plugin-simple-import-sort: ^10.0.0
|
||||
eslint-plugin-unused-imports: ^2.0.0
|
||||
fake-indexeddb: 4.0.1
|
||||
@ -10618,7 +10619,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint-plugin-react-hooks@npm:^4.5.0":
|
||||
"eslint-plugin-react-hooks@npm:^4.5.0, eslint-plugin-react-hooks@npm:^4.6.0":
|
||||
version: 4.6.0
|
||||
resolution: "eslint-plugin-react-hooks@npm:4.6.0"
|
||||
peerDependencies:
|
||||
|
Loading…
Reference in New Issue
Block a user