mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-18 14:20:42 -07:00
fix audio export path resolution
This commit is contained in:
@@ -10,9 +10,20 @@ export const tauriFilesystem: PlatformFilesystem = {
|
||||
});
|
||||
|
||||
if (filePath) {
|
||||
const { writeBinaryFile } = await import('@tauri-apps/plugin-fs');
|
||||
const resolvedPath =
|
||||
typeof filePath === 'string'
|
||||
? filePath
|
||||
: filePath && typeof filePath === 'object' && 'path' in filePath
|
||||
? (filePath as { path: string }).path
|
||||
: '';
|
||||
|
||||
if (!resolvedPath) {
|
||||
throw new Error('Failed to resolve save path');
|
||||
}
|
||||
|
||||
const { writeFile } = await import('@tauri-apps/plugin-fs');
|
||||
const arrayBuffer = await blob.arrayBuffer();
|
||||
await writeBinaryFile(filePath, new Uint8Array(arrayBuffer));
|
||||
await writeFile(resolvedPath, new Uint8Array(arrayBuffer));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to use Tauri dialog, falling back to browser download:', error);
|
||||
|
||||
Reference in New Issue
Block a user