feat: use @affine/debug (#1244)

This commit is contained in:
Himself65
2023-03-01 20:13:45 -06:00
committed by GitHub
parent 1abab690af
commit a099ed5f29
15 changed files with 40 additions and 252 deletions

View File

@@ -1,5 +1,5 @@
import { Workspace } from '@affine/datacenter';
import { config } from '@affine/env';
import { config, getEnvironment } from '@affine/env';
import { nanoid } from '@blocksuite/store';
import { useCallback, useMemo, useSyncExternalStore } from 'react';
import useSWR from 'swr';
@@ -88,6 +88,9 @@ const emptyWorkspaces: RemWorkspace[] = [];
export async function refreshDataCenter(signal?: AbortSignal) {
dataCenter.isLoaded = false;
dataCenter.callbacks.forEach(cb => cb());
if (getEnvironment().isServer) {
return;
}
// fixme(himself65): `prefetchWorkspace` is not used
// use `config.enablePlugin = ['affine', 'local']` instead
// if (!config.prefetchWorkspace) {