added password setting error UI

This commit is contained in:
Danny Coates 2018-02-21 12:35:52 -08:00
parent c18f488be7
commit 14b40d820b
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
9 changed files with 63 additions and 48 deletions

View file

@ -21,11 +21,17 @@ export default class OwnedFile {
}
async setPassword(password) {
this.password = password;
this._hasPassword = true;
this.keychain.setPassword(password, this.url);
const result = await setPassword(this.id, this.ownerToken, this.keychain);
return result;
try {
this.password = password;
this._hasPassword = true;
this.keychain.setPassword(password, this.url);
const result = await setPassword(this.id, this.ownerToken, this.keychain);
return result;
} catch (e) {
this.password = null;
this._hasPassword = false;
throw e;
}
}
del() {