ci(core): eslint errors for core (#4662)

This commit is contained in:
Joooye_34
2023-11-10 18:25:59 +08:00
committed by GitHub
parent b98a258083
commit 30bac7dce2
44 changed files with 264 additions and 140 deletions

View File

@@ -1,4 +1,5 @@
import { NotFoundPage } from '@affine/component/not-found-page';
import { useAsyncCallback } from '@toeverything/hooks/affine-async-hooks';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { useSession } from 'next-auth/react';
import type { ReactElement } from 'react';
@@ -22,7 +23,7 @@ export const Component = (): ReactElement => {
setOpen(true);
}, [setOpen]);
const onConfirmSignOut = useCallback(async () => {
const onConfirmSignOut = useAsyncCallback(async () => {
setOpen(false);
await signOutCloud({
callbackUrl: '/signIn',

View File

@@ -14,6 +14,7 @@ import {
PageIcon,
ViewLayersIcon,
} from '@blocksuite/icons';
import { useAsyncCallback } from '@toeverything/hooks/affine-async-hooks';
import { getCurrentStore } from '@toeverything/infra/atom';
import { useAtomValue } from 'jotai';
import { useSetAtom } from 'jotai';
@@ -92,11 +93,13 @@ export const Component = function CollectionPage() {
const Placeholder = ({ collection }: { collection: Collection }) => {
const { updateCollection } = useCollectionManager(collectionsCRUDAtom);
const { node, open } = useEditCollection(useAllPageListConfig());
const openPageEdit = useCallback(() => {
open({ ...collection }, 'page').then(updateCollection);
const openPageEdit = useAsyncCallback(async () => {
const ret = await open({ ...collection }, 'page');
await updateCollection(ret);
}, [open, collection, updateCollection]);
const openRuleEdit = useCallback(() => {
open({ ...collection }, 'rule').then(updateCollection);
const openRuleEdit = useAsyncCallback(async () => {
const ret = await open({ ...collection }, 'rule');
await updateCollection(ret);
}, [collection, open, updateCollection]);
const [showTips, setShowTips] = useState(false);
useEffect(() => {