mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-05-30 05:06:58 +00:00
add file-saver as backup
This commit is contained in:
parent
c14d7a0f60
commit
2a4866a679
@ -11,7 +11,7 @@ import {
|
|||||||
registerTranslateConfig({
|
registerTranslateConfig({
|
||||||
loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()),
|
loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()),
|
||||||
});
|
});
|
||||||
|
import FileSaver from 'file-saver'
|
||||||
import * as actions from '../../components/qdn-action-types';
|
import * as actions from '../../components/qdn-action-types';
|
||||||
import '@material/mwc-button';
|
import '@material/mwc-button';
|
||||||
import '@material/mwc-icon';
|
import '@material/mwc-icon';
|
||||||
@ -1454,6 +1454,8 @@ class WebBrowser extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const fileHandle = await self.showSaveFilePicker({
|
const fileHandle = await self.showSaveFilePicker({
|
||||||
suggestedName: filename,
|
suggestedName: filename,
|
||||||
types: [
|
types: [
|
||||||
@ -1471,6 +1473,10 @@ class WebBrowser extends LitElement {
|
|||||||
await writable.close()
|
await writable.close()
|
||||||
}
|
}
|
||||||
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
||||||
|
} catch (error) {
|
||||||
|
FileSaver.saveAs(blob, filename)
|
||||||
|
}
|
||||||
|
|
||||||
response = JSON.stringify(true);
|
response = JSON.stringify(true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user