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