change back
This commit is contained in:
parent
ac01c351d5
commit
77d364dfed
@ -37,7 +37,7 @@ const App = ({ store }) => {
|
||||
}
|
||||
|
||||
export let sce
|
||||
export let fs
|
||||
// export let fs
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
|
||||
@ -47,7 +47,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
|
||||
ReactDOM.render(<App store={store} />, document.getElementById('react'));
|
||||
|
||||
fs = await import ('../../node_modules/browser-fs-access/dist/index')
|
||||
// fs = await import ('../../node_modules/browser-fs-access/dist/index')
|
||||
|
||||
});
|
||||
|
||||
|
@ -5,10 +5,10 @@
|
||||
// fileSave,
|
||||
// } from '../../extlib/fs/index';
|
||||
|
||||
// import {
|
||||
// fileOpen,
|
||||
// fileSave,
|
||||
// } from 'browser-fs-access';
|
||||
import {
|
||||
fileOpen,
|
||||
fileSave,
|
||||
} from 'browser-fs-access';
|
||||
|
||||
import {sce, fs} from './app'
|
||||
|
||||
@ -38,7 +38,7 @@ export async function saveFile(fileHandle, file, dispatch) {
|
||||
return await saveFileAs(file, dispatch);
|
||||
}
|
||||
|
||||
await fs.fileSave(new Blob([file], { type: 'application/json' }), undefined, fileHandle, true)
|
||||
await fileSave(new Blob([file], { type: 'application/json' }), undefined, fileHandle, true)
|
||||
|
||||
dispatch({ type: 'set-modified', status: false })
|
||||
} catch (ex) {
|
||||
@ -51,7 +51,7 @@ export async function saveFile(fileHandle, file, dispatch) {
|
||||
export async function saveFileAs(file, dispatch) {
|
||||
|
||||
try {
|
||||
const fileHandle = await fs.fileSave(new Blob([file], { type: 'application/json' }), {
|
||||
const fileHandle = await fileSave(new Blob([file], { type: 'application/json' }), {
|
||||
extensions: ['.json'],
|
||||
})
|
||||
|
||||
@ -80,7 +80,7 @@ export async function openFile(dispatch) {
|
||||
description: 'Part files',
|
||||
};
|
||||
|
||||
file = await fs.fileOpen(options);
|
||||
file = await fileOpen(options);
|
||||
|
||||
} catch (ex) {
|
||||
if (ex.name === 'AbortError') {
|
||||
|
Loading…
Reference in New Issue
Block a user