mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-23 11:56:00 +01:00
Reject form promises for proper error handling (#371)
This commit is contained in:
parent
1b8f6aace2
commit
2750ca7586
@ -301,7 +301,6 @@ export class AddEditComponent implements OnInit {
|
|||||||
|
|
||||||
this.formPromise = this.encryptSend(file)
|
this.formPromise = this.encryptSend(file)
|
||||||
.then(async encSend => {
|
.then(async encSend => {
|
||||||
try {
|
|
||||||
const uploadPromise = this.sendService.saveWithServer(encSend);
|
const uploadPromise = this.sendService.saveWithServer(encSend);
|
||||||
let inactive = false;
|
let inactive = false;
|
||||||
setTimeout(() => inactive = true, 4500);
|
setTimeout(() => inactive = true, 4500);
|
||||||
@ -317,12 +316,13 @@ export class AddEditComponent implements OnInit {
|
|||||||
if (this.copyLink) {
|
if (this.copyLink) {
|
||||||
this.copyLinkToClipboard(this.link);
|
this.copyLinkToClipboard(this.link);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.formPromise;
|
||||||
return true;
|
return true;
|
||||||
} catch { }
|
} catch { }
|
||||||
return false;
|
return false;
|
||||||
});
|
|
||||||
|
|
||||||
return await this.formPromise;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async showSuccessMessage(inactive: boolean) {
|
async showSuccessMessage(inactive: boolean) {
|
||||||
|
Loading…
Reference in New Issue
Block a user