[PS-1901] Add menu item to remove a previously set password from a Send (#4100)

* Remove a previously set password from a Send

* Only refresh if the send item was selected before

* Display menuItem only when a password has been set
This commit is contained in:
Daniel James Smith 2022-12-02 21:10:03 +01:00 committed by GitHub
parent 9dc72428d0
commit e9781b4214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -132,6 +132,18 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro
label: this.i18nService.t("copyLink"),
click: () => this.copy(send),
});
if (send.password && !send.disabled) {
menu.push({
label: this.i18nService.t("removePassword"),
click: async () => {
await this.removePassword(send);
if (this.sendId === send.id) {
this.sendId = null;
this.selectSend(send.id);
}
},
});
}
menu.push({
label: this.i18nService.t("delete"),
click: async () => {

View File

@ -1779,6 +1779,15 @@
"disabled": {
"message": "Disabled"
},
"removePassword": {
"message": "Remove password"
},
"removedPassword": {
"message": "Password removed"
},
"removePasswordConfirmation": {
"message": "Are you sure you want to remove the password?"
},
"maxAccessCountReached": {
"message": "Max access count reached"
},