Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api/src/yjs-blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async function loadFromDB(ydoc: Y.Doc, repoId: string) {
} else {
if (repo.pods.length > 0) {
// TODO run the migration script seprately.
migrate_v_0_0_1(ydoc, repoId);
await migrate_v_0_0_1(ydoc, repoId);
} else {
// init the ydoc
const rootMap = ydoc.getMap("rootMap");
Expand All @@ -151,7 +151,7 @@ export async function bindState(doc: Y.Doc, repoId: string) {
// Load persisted document state from the database.
await loadFromDB(doc, repoId);
// Observe changes and write to the database.
await setupObserversToDB(doc, repoId);
setupObserversToDB(doc, repoId);
}

export function writeState() {
Expand Down Expand Up @@ -193,8 +193,8 @@ async function migrate_v_0_0_1(ydoc: Y.Doc, repoId: string) {
const edgesMap = new Y.Map<ReactflowEdge>();
const codeMap = new Y.Map<Y.Text>();
const richMap = new Y.Map<Y.XmlFragment>();
rootMap.set("nodesMap", new Y.Map<ReactflowNode>());
rootMap.set("edgesMap", new Y.Map<ReactflowEdge>());
rootMap.set("nodesMap", nodesMap);
rootMap.set("edgesMap", edgesMap);
rootMap.set("codeMap", codeMap);
rootMap.set("richMap", richMap);
const metaMap = new Y.Map();
Expand Down