mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-01 01:52:42 +03:00
fix: flaky tests (#3507)
This commit is contained in:
parent
70f3508005
commit
35a4c63c27
@ -8,7 +8,13 @@ import {
|
||||
} from '@toeverything/plugin-infra/atom';
|
||||
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
|
||||
import type { FC, ReactElement } from 'react';
|
||||
import { lazy, Suspense, useCallback, useTransition } from 'react';
|
||||
import {
|
||||
lazy,
|
||||
startTransition,
|
||||
Suspense,
|
||||
useCallback,
|
||||
useTransition,
|
||||
} from 'react';
|
||||
|
||||
import type { SettingAtom } from '../atoms';
|
||||
import {
|
||||
@ -195,11 +201,13 @@ export const AllWorkspaceModals = (): ReactElement => {
|
||||
setOpenCreateWorkspaceModal(false);
|
||||
}, [setOpenCreateWorkspaceModal])}
|
||||
onCreate={useCallback(
|
||||
async id => {
|
||||
setOpenCreateWorkspaceModal(false);
|
||||
setOpenWorkspacesModal(false);
|
||||
setCurrentWorkspaceId(id);
|
||||
return jumpToSubPath(id, WorkspaceSubPath.ALL);
|
||||
id => {
|
||||
startTransition(() => {
|
||||
setOpenCreateWorkspaceModal(false);
|
||||
setOpenWorkspacesModal(false);
|
||||
setCurrentWorkspaceId(id);
|
||||
jumpToSubPath(id, WorkspaceSubPath.ALL);
|
||||
});
|
||||
},
|
||||
[
|
||||
jumpToSubPath,
|
||||
|
@ -14,7 +14,7 @@ import { localProviderLogger as logger } from './logger';
|
||||
|
||||
const Y = BlockSuiteWorkspace.Y;
|
||||
|
||||
const sqliteOrigin = Symbol('sqlite-provider-origin');
|
||||
const sqliteOrigin = 'sqlite-provider-origin';
|
||||
|
||||
const createDatasource = (workspaceId: string): DatasourceDocAdapter => {
|
||||
if (!window.apis?.db) {
|
||||
|
Loading…
Reference in New Issue
Block a user