diff --git a/src/state/drafts/storage.ts b/src/state/drafts/storage.ts index a18cbdb479..95fcea6b66 100644 --- a/src/state/drafts/storage.ts +++ b/src/state/drafts/storage.ts @@ -35,10 +35,10 @@ function ensureDirectory(): void { /** * Save a media file to local storage by localRefPath key */ -export function saveMediaToLocal( +export async function saveMediaToLocal( localRefPath: string, sourcePath: string, -): void { +): Promise { ensureDirectory() const destFile = getMediaFile(localRefPath) @@ -69,7 +69,9 @@ export function saveMediaToLocal( * Load a media file path from local storage * @returns The file URI for the saved media */ -export function loadMediaFromLocal(localRefPath: string): string { +export async function loadMediaFromLocal( + localRefPath: string, +): Promise { const file = getMediaFile(localRefPath) if (!file.exists) { @@ -82,7 +84,9 @@ export function loadMediaFromLocal(localRefPath: string): string { /** * Delete a media file from local storage */ -export function deleteMediaFromLocal(localRefPath: string): void { +export async function deleteMediaFromLocal( + localRefPath: string, +): Promise { const file = getMediaFile(localRefPath) // Idempotent: only delete if file exists if (file.exists) {