mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-25 19:08:04 +01:00
Rename files
This commit is contained in:
16
ts/util/deleteDraftAttachment.preload.ts
Normal file
16
ts/util/deleteDraftAttachment.preload.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { AttachmentType } from '../types/Attachment.std.js';
|
||||
import { deleteDraftFile } from './migrations.preload.js';
|
||||
|
||||
export async function deleteDraftAttachment(
|
||||
attachment: Pick<AttachmentType, 'screenshotPath' | 'path'>
|
||||
): Promise<void> {
|
||||
if (attachment.screenshotPath) {
|
||||
await deleteDraftFile(attachment.screenshotPath);
|
||||
}
|
||||
if (attachment.path) {
|
||||
await deleteDraftFile(attachment.path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user