mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 21:18:12 +08:00
Desktop: Unify save file handling and add file dialog for export (#3008)
* Prepare save file unification * Desktop add save file dialog
This commit is contained in:
@@ -15,10 +15,10 @@ export function downloadFileBlob(filename: string, blob: Blob) {
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
export function downloadFileText(filename: string, text: string) {
|
||||
const type = filename.endsWith(".svg") ? "image/svg+xml;charset=utf-8" : "text/plain;charset=utf-8";
|
||||
export function downloadFile(filename: string, content: Uint8Array) {
|
||||
const type = filename.endsWith(".svg") ? "image/svg+xml;charset=utf-8" : "application/octet-stream";
|
||||
|
||||
const blob = new Blob([text], { type });
|
||||
const blob = new Blob([content], { type });
|
||||
downloadFileBlob(filename, blob);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user