diff options
author | Marvin Borner | 2019-01-27 18:04:38 +0100 |
---|---|---|
committer | Marvin Borner | 2019-01-27 18:04:38 +0100 |
commit | dfce4c5a178275f4b7226ae397226cbbf84571a8 (patch) | |
tree | 267bb6e3275e92dc8b781229f8087996ed1df753 /public/scripts/2_encryption.js | |
parent | 46f92ac829cfaeb255317c99a0cb220e1ff6b071 (diff) |
Added 3 retries
Diffstat (limited to 'public/scripts/2_encryption.js')
-rw-r--r-- | public/scripts/2_encryption.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/public/scripts/2_encryption.js b/public/scripts/2_encryption.js index a6f610e..7c7fb9b 100644 --- a/public/scripts/2_encryption.js +++ b/public/scripts/2_encryption.js @@ -10,7 +10,6 @@ let db; */ function setupDatabase() { db = new Dexie('texx'); - window.db = db; db.version(2).stores({ own_keys: '&key_type, key_data', peer_keys: 'peer_id, key_data', @@ -179,6 +178,15 @@ async function getPeerPublicKey(peerId) { } /** + * Resets the database/encryption + */ +function reset() { + db.delete(); + localStorage.removeItem('database'); + console.log('[LOG] Database has been deleted!') +} + +/** * Just a general test case */ function testEncryption() { @@ -202,4 +210,5 @@ exports.decryptPrivate = decryptPrivateKey; exports.check = isEncrypted; exports.store = storePeerPublicKey; exports.get = getPeerPublicKey; +exports.reset = reset; exports.test = testEncryption; |