Merge remote-tracking branch 'origin/develop' into feat/update-get-started-template

This commit is contained in:
alt0
2022-08-12 18:10:07 +08:00
19 changed files with 358 additions and 239 deletions
@@ -37,6 +37,11 @@ async function _getCurrentToken() {
return undefined;
}
const _enabled = {
demo: [],
AFFiNE: ['sqlite'],
} as any;
async function _getBlockDatabase(
workspace: string,
options?: BlockInitOptions
@@ -45,16 +50,10 @@ async function _getBlockDatabase(
await waitLoading(workspace);
}
// if (
// options?.userId &&
// workspaces[workspace]?.getUserId() !== options?.userId
// ) {
// delete workspaces[workspace];
// }
if (!workspaces[workspace]) {
loading.add(workspace);
workspaces[workspace] = await BlockClient.init(workspace, {
enabled: _enabled[workspace] || ['idb'],
...options,
token: await _getCurrentToken(),
});