chore: prohibit unnecessary await (#4586)

This commit is contained in:
Alex Yang
2023-10-12 00:04:58 -05:00
committed by GitHub
parent 5ebd82dc04
commit d05897b724
19 changed files with 104 additions and 104 deletions

View File

@@ -358,9 +358,7 @@ function createSetupImpl(rootStore: ReturnType<typeof createStore>) {
},
}
),
navigator: {
userAgent: navigator.userAgent,
},
navigator: globalThis.navigator,
MouseEvent: globalThis.MouseEvent,
KeyboardEvent: globalThis.KeyboardEvent,

View File

@@ -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;
}

View File

@@ -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]
),

View File

@@ -70,7 +70,7 @@ export const Component = (): ReactElement => {
isPublic
workspace={page.workspace}
pageId={page.id}
onInit={useCallback(() => noop, [])}
onInit={noop}
onLoad={useCallback(() => noop, [])}
/>
</MainContainer>