mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +01:00
Fixing Successful toast message does not appear (#4421)
This commit is contained in:
parent
d79fd7f417
commit
6b1a72851a
@ -201,25 +201,14 @@ export class AddEditComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
this.onSavedSend.emit(this.send);
|
this.onSavedSend.emit(this.send);
|
||||||
if (this.copyLink && this.link != null) {
|
if (this.copyLink && this.link != null) {
|
||||||
const copySuccess = await this.copyLinkToClipboard(this.link);
|
await this.handleCopyLinkToClipboard();
|
||||||
if (copySuccess ?? true) {
|
return;
|
||||||
this.platformUtilsService.showToast(
|
|
||||||
"success",
|
|
||||||
null,
|
|
||||||
this.i18nService.t(this.editMode ? "editedSend" : "createdSend")
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await this.platformUtilsService.showDialog(
|
|
||||||
this.i18nService.t(this.editMode ? "editedSend" : "createdSend"),
|
|
||||||
null,
|
|
||||||
this.i18nService.t("ok"),
|
|
||||||
null,
|
|
||||||
"success",
|
|
||||||
null
|
|
||||||
);
|
|
||||||
await this.copyLinkToClipboard(this.link);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
this.platformUtilsService.showToast(
|
||||||
|
"success",
|
||||||
|
null,
|
||||||
|
this.i18nService.t(this.editMode ? "editedSend" : "createdSend")
|
||||||
|
);
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
@ -308,4 +297,24 @@ export class AddEditComponent implements OnInit, OnDestroy {
|
|||||||
this.showPassword = !this.showPassword;
|
this.showPassword = !this.showPassword;
|
||||||
document.getElementById("password").focus();
|
document.getElementById("password").focus();
|
||||||
}
|
}
|
||||||
|
private async handleCopyLinkToClipboard() {
|
||||||
|
const copySuccess = await this.copyLinkToClipboard(this.link);
|
||||||
|
if (copySuccess ?? true) {
|
||||||
|
this.platformUtilsService.showToast(
|
||||||
|
"success",
|
||||||
|
null,
|
||||||
|
this.i18nService.t(this.editMode ? "editedSend" : "createdSend")
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t(this.editMode ? "editedSend" : "createdSend"),
|
||||||
|
null,
|
||||||
|
this.i18nService.t("ok"),
|
||||||
|
null,
|
||||||
|
"success",
|
||||||
|
null
|
||||||
|
);
|
||||||
|
await this.copyLinkToClipboard(this.link);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user