Skip to content

Commit

Permalink
feat(db): merge person from myself and people
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Sep 23, 2019
1 parent 5c8ab6a commit 723f9c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/database/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,11 @@ export async function queryPeopleDB(
export async function queryPersonDB(id: PersonIdentifier): Promise<null | PersonRecord> {
const t = (await db).transaction('people', 'readonly')
const result = await t.objectStore('people').get(id.toText())
if (!result) return null
return outDb(result)

const t2 = (await db).transaction('myself', 'readonly')
const result2 = await t2.objectStore('myself').get(id.toText())
if (!result && !result2) return null
return outDb(Object.assign({}, result, result2))
}
/**
* Update Person info with a identifier
Expand Down

0 comments on commit 723f9c0

Please sign in to comment.