adds delete app data functionality
This commit is contained in:
+10
@@ -223,12 +223,22 @@ export async function changeEncryptionAndRestartApp(hash) {
|
||||
restart.Restart()
|
||||
}
|
||||
|
||||
export function isDbEmpty () {
|
||||
return db.empty
|
||||
}
|
||||
|
||||
export async function deleteDbAndOpenNew() {
|
||||
const exists = await fs.exists(Realm.defaultPath)
|
||||
if (exists) await fs.unlink(Realm.defaultPath)
|
||||
await openDb()
|
||||
}
|
||||
|
||||
export async function clearDb() {
|
||||
await db.write(async () => {
|
||||
await db.deleteAll()
|
||||
})
|
||||
}
|
||||
|
||||
function hashToInt8Array(hash) {
|
||||
const key = new Uint8Array(64)
|
||||
for (let i = 0; i < key.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user