From e9781b42148f13dc32caa988e80c85a616d89e58 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Fri, 2 Dec 2022 21:10:03 +0100 Subject: [PATCH] [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 --- apps/desktop/src/app/send/send.component.ts | 12 ++++++++++++ apps/desktop/src/locales/en/messages.json | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/apps/desktop/src/app/send/send.component.ts b/apps/desktop/src/app/send/send.component.ts index 4c96a93ae4..2ba29cc4ad 100644 --- a/apps/desktop/src/app/send/send.component.ts +++ b/apps/desktop/src/app/send/send.component.ts @@ -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 () => { diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json index fd168510b3..1ca90e8ce2 100644 --- a/apps/desktop/src/locales/en/messages.json +++ b/apps/desktop/src/locales/en/messages.json @@ -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" },