Add restoreSecrets
This commit is contained in:
parent
0b45ff3962
commit
113f036838
@ -104,6 +104,7 @@ async function init(): Promise<void> {
|
|||||||
await services.restoreDevice(device);
|
await services.restoreDevice(device);
|
||||||
}
|
}
|
||||||
await services.restoreProcesses();
|
await services.restoreProcesses();
|
||||||
|
await services.restoreSecrets();
|
||||||
|
|
||||||
if (services.isPaired()) {
|
if (services.isPaired()) {
|
||||||
await navigate('process');
|
await navigate('process');
|
||||||
|
@ -488,6 +488,22 @@ export default class Services {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async restoreSecrets() {
|
||||||
|
const db = await Database.getInstance();
|
||||||
|
try {
|
||||||
|
const sharedSecrets: Record<string, string> = await db.dumpStore('shared_secrets');
|
||||||
|
const unconfirmedSecrets = await db.dumpStore('unconfirmed_secrets');
|
||||||
|
const secretsStore = {
|
||||||
|
'shared_secrets': sharedSecrets,
|
||||||
|
'unconfirmed_secrets': Object.values(unconfirmedSecrets),
|
||||||
|
};
|
||||||
|
this.sdkClient.set_shared_secrets(JSON.stringify(secretsStore));
|
||||||
|
} catch (e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
getNotifications(): INotification[] {
|
getNotifications(): INotification[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user