mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore: prohibit unnecessary await (#4586)
This commit is contained in:
@@ -358,9 +358,7 @@ function createSetupImpl(rootStore: ReturnType<typeof createStore>) {
|
||||
},
|
||||
}
|
||||
),
|
||||
navigator: {
|
||||
userAgent: navigator.userAgent,
|
||||
},
|
||||
navigator: globalThis.navigator,
|
||||
|
||||
MouseEvent: globalThis.MouseEvent,
|
||||
KeyboardEvent: globalThis.KeyboardEvent,
|
||||
|
||||
@@ -42,7 +42,10 @@ export interface PageDetailEditorProps {
|
||||
isPublic?: boolean;
|
||||
workspace: Workspace;
|
||||
pageId: string;
|
||||
onInit: (page: Page, editor: Readonly<EditorContainer>) => void;
|
||||
onInit: (
|
||||
page: Page,
|
||||
editor: Readonly<EditorContainer>
|
||||
) => Promise<void> | void;
|
||||
onLoad?: OnLoadEditor;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ export function useAppHelper() {
|
||||
targetWorkspace
|
||||
);
|
||||
// delete workspace from jotai storage
|
||||
await set(workspaces => workspaces.filter(ws => ws.id !== workspaceId));
|
||||
set(workspaces => workspaces.filter(ws => ws.id !== workspaceId));
|
||||
},
|
||||
[jotaiWorkspaces, set]
|
||||
),
|
||||
|
||||
@@ -70,7 +70,7 @@ export const Component = (): ReactElement => {
|
||||
isPublic
|
||||
workspace={page.workspace}
|
||||
pageId={page.id}
|
||||
onInit={useCallback(() => noop, [])}
|
||||
onInit={noop}
|
||||
onLoad={useCallback(() => noop, [])}
|
||||
/>
|
||||
</MainContainer>
|
||||
|
||||
Reference in New Issue
Block a user