From 6602d35573eb0bea0149270193668d7c73dff20e Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Thu, 9 Jul 2020 15:44:28 +0200 Subject: [PATCH] refactor: use new snjs protocol upgrade API --- app/assets/javascripts/ui_models/application.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/ui_models/application.ts b/app/assets/javascripts/ui_models/application.ts index dad9bd931..8046e8731 100644 --- a/app/assets/javascripts/ui_models/application.ts +++ b/app/assets/javascripts/ui_models/application.ts @@ -168,13 +168,14 @@ export class WebApplication extends SNApplication { } async performProtocolUpgrade() { - const errors = await this.upgradeProtocolVersion(); - if (!errors || errors.length === 0) { + const result = await this.upgradeProtocolVersion(); + if (result.success) { this.alertService!.alert( "Success! Your encryption version has been upgraded." + " You'll be asked to enter your credentials again on other devices you're signed into." ); - } else { + } else if (result.error) { + console.error(result.error); this.alertService!.alert( "Unable to upgrade encryption version. Please try again." );