MCPcopy Create free account
hub / github.com/bitwarden/clients / delete

Method delete

libs/angular/src/tools/send/send.component.ts:206–243  ·  view source on GitHub ↗
(s: SendView)

Source from the content-addressed store, hash-verified

204 }
205
206 async delete(s: SendView): Promise<boolean> {
207 if (this.actionPromise != null) {
208 return false;
209 }
210
211 const confirmed = await this.dialogService.openSimpleDialog({
212 title: { key: "deleteSend" },
213 content: { key: "deleteSendConfirmation" },
214 type: "warning",
215 });
216
217 if (!confirmed) {
218 return false;
219 }
220
221 try {
222 this.actionPromise = this.sendApiService.delete(s.id);
223 await this.actionPromise;
224
225 if (this.onSuccessfulDelete != null) {
226 // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
227 // eslint-disable-next-line @typescript-eslint/no-floating-promises
228 this.onSuccessfulDelete();
229 } else {
230 // Default actions
231 this.toastService.showToast({
232 variant: "success",
233 title: null,
234 message: this.i18nService.t("deletedSend"),
235 });
236 await this.refresh();
237 }
238 } catch (e) {
239 this.logService.error(e);
240 }
241 this.actionPromise = null;
242 return true;
243 }
244
245 async copy(s: SendView) {
246 const env = await firstValueFrom(this.environmentService.environment$);

Callers 8

deleteSendMethod · 0.45
deleteCollectionsMethod · 0.45
expandOrgFilterMethod · 0.45
unregisterTaskHandlerMethod · 0.45
removeMethod · 0.45

Calls 5

refreshMethod · 0.95
errorMethod · 0.65
openSimpleDialogMethod · 0.45
showToastMethod · 0.45
tMethod · 0.45

Tested by

no test coverage detected