fix: async provider
This commit is contained in:
@@ -78,7 +78,7 @@ async function _initYjsDatabase(
|
|||||||
await _waitLoading(workspace);
|
await _waitLoading(workspace);
|
||||||
}
|
}
|
||||||
const instance = _yjsDatabaseInstance.get(workspace);
|
const instance = _yjsDatabaseInstance.get(workspace);
|
||||||
// tTODO:odo temporarily handle this
|
// TODO: temporarily handle this
|
||||||
if (
|
if (
|
||||||
instance &&
|
instance &&
|
||||||
(instance.userId === options.userId || options.userId === 'default')
|
(instance.userId === options.userId || options.userId === 'default')
|
||||||
@@ -110,7 +110,7 @@ async function _initYjsDatabase(
|
|||||||
const emitState = (c: Connectivity) =>
|
const emitState = (c: Connectivity) =>
|
||||||
connListener.listeners?.(workspace, c);
|
connListener.listeners?.(workspace, c);
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
Object.entries(options.provider).flatMap(async ([, p]) => [
|
Object.entries(options.provider).flatMap(([, p]) => [
|
||||||
p({ awareness, doc, token, workspace, emitState }),
|
p({ awareness, doc, token, workspace, emitState }),
|
||||||
p({
|
p({
|
||||||
awareness,
|
awareness,
|
||||||
|
|||||||
Reference in New Issue
Block a user