Fixing an issue introduced here which caused template test to fail.
This commit is contained in:
parent
0a5a788440
commit
f0f8c14216
1 changed files with 6 additions and 7 deletions
|
@ -108,16 +108,15 @@ async function buildBaseDefinition(): Promise<PreSaveSQLiteDefinition> {
|
||||||
export async function syncDefinition(): Promise<void> {
|
export async function syncDefinition(): Promise<void> {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
let rev: string | undefined
|
let rev: string | undefined
|
||||||
try {
|
if (await db.exists(SQLITE_DESIGN_DOC_ID)) {
|
||||||
const existing = await db.get(SQLITE_DESIGN_DOC_ID)
|
const existing = await db.get(SQLITE_DESIGN_DOC_ID)
|
||||||
rev = existing._rev
|
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) {
|
export async function addTable(table: Table) {
|
||||||
|
|
Loading…
Reference in a new issue