refactor: use new snjs protocol upgrade API

This commit is contained in:
Baptiste Grob
2020-07-09 15:44:28 +02:00
parent 5656edb385
commit 6602d35573

View File

@@ -168,13 +168,14 @@ export class WebApplication extends SNApplication {
} }
async performProtocolUpgrade() { async performProtocolUpgrade() {
const errors = await this.upgradeProtocolVersion(); const result = await this.upgradeProtocolVersion();
if (!errors || errors.length === 0) { if (result.success) {
this.alertService!.alert( this.alertService!.alert(
"Success! Your encryption version has been upgraded." + "Success! Your encryption version has been upgraded." +
" You'll be asked to enter your credentials again on other devices you're signed into." " 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( this.alertService!.alert(
"Unable to upgrade encryption version. Please try again." "Unable to upgrade encryption version. Please try again."
); );