mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +08:00
fix: quick search in public workspace (#1706)
This commit is contained in:
@@ -13,18 +13,11 @@ export const publicBlockSuiteAtom = atom<Promise<BlockSuiteWorkspace>>(
|
||||
throw new Error('No workspace id');
|
||||
}
|
||||
const binary = await affineApis.downloadWorkspace(workspaceId, true);
|
||||
// fixme: this is a hack
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const prefixUrl = params.get('prefixUrl')
|
||||
? (params.get('prefixUrl') as string)
|
||||
: '/';
|
||||
const blockSuiteWorkspace = createEmptyBlockSuiteWorkspace(
|
||||
workspaceId,
|
||||
(k: string) =>
|
||||
// fixme: token could be expired
|
||||
({ api: `${prefixUrl}api/workspace`, token: getLoginStorage()?.token }[
|
||||
k
|
||||
])
|
||||
({ api: `api/workspace`, token: getLoginStorage()?.token }[k])
|
||||
);
|
||||
BlockSuiteWorkspace.Y.applyUpdate(
|
||||
blockSuiteWorkspace.doc,
|
||||
@@ -39,19 +32,6 @@ export const publicBlockSuiteAtom = atom<Promise<BlockSuiteWorkspace>>(
|
||||
);
|
||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_slash_menu', false);
|
||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_drag_handle', false);
|
||||
return new Promise(resolve => {
|
||||
setTimeout(() => {
|
||||
// const workspace: LocalWorkspace = {
|
||||
// id: workspaceId,
|
||||
// blockSuiteWorkspace,
|
||||
// flavour: RemWorkspaceFlavour.LOCAL,
|
||||
// providers: [],
|
||||
// };
|
||||
// fixme: quick search won't work, ASAP
|
||||
// dataCenter.workspaces.push(workspace);
|
||||
// dataCenter.callbacks.forEach(cb => cb());
|
||||
resolve(blockSuiteWorkspace);
|
||||
}, 0);
|
||||
});
|
||||
return blockSuiteWorkspace;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user