From 9588ca7749d579904a9496869f6a8a92b54b0d55 Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Mon, 13 Mar 2023 13:19:43 +0100 Subject: [PATCH] Regression that prevented initial configuration --- src/db/lib.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/db/lib.ts b/src/db/lib.ts index db0f0a4..ef27af9 100644 --- a/src/db/lib.ts +++ b/src/db/lib.ts @@ -25,7 +25,7 @@ export const put = async ( let to; try { const parent = await db.get(parentId); -// console.log({ caller: 'put', parent }); + // console.log({ caller: 'put', parent }); to = parent.to; } catch {} current = { _rev: undefined, to, doc: cloneDeep(defaultDoc) }; @@ -36,7 +36,9 @@ export const put = async ( _rev: current._rev, type, to: current.to, - origin: current.origin ?? dbUrlToUserId(state().remoteUrl), + origin: + current.origin ?? + (state().remoteUrl ? dbUrlToUserId(state().remoteUrl) : undefined), doc: update(current.doc), }; await targetDb.put(putDoc);