mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-27 03:52:41 +03:00
fix: prefix url (#1361)
This commit is contained in:
parent
0f82851766
commit
76a83fd60b
@ -12,9 +12,16 @@ export const publicBlockSuiteAtom = atom<Promise<BlockSuiteWorkspace>>(
|
||||
throw new Error('No workspace id');
|
||||
}
|
||||
const binary = await apis.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,
|
||||
(_: string) => undefined
|
||||
(k: string) =>
|
||||
// fixme: token could be expired
|
||||
({ api: `${prefixUrl}api/workspace`, token: apis.auth.token }[k])
|
||||
);
|
||||
BlockSuiteWorkspace.Y.applyUpdate(
|
||||
blockSuiteWorkspace.doc,
|
||||
|
Loading…
Reference in New Issue
Block a user