Fixing an issue introduced here which caused template test to fail.

This commit is contained in:
mike12345567 2024-06-06 14:58:03 +01:00
parent 0a5a788440
commit f0f8c14216
1 changed files with 6 additions and 7 deletions

View File

@ -108,16 +108,15 @@ async function buildBaseDefinition(): Promise<PreSaveSQLiteDefinition> {
export async function syncDefinition(): Promise<void> {
const db = context.getAppDB()
let rev: string | undefined
try {
if (await db.exists(SQLITE_DESIGN_DOC_ID)) {
const existing = await db.get(SQLITE_DESIGN_DOC_ID)
rev = existing._rev
} finally {
const definition = await buildBaseDefinition()
if (rev) {
definition._rev = rev
}
await db.put(definition)
}
const definition = await buildBaseDefinition()
if (rev) {
definition._rev = rev
}
await db.put(definition)
}
export async function addTable(table: Table) {