More tauri removal
This commit is contained in:
@ -124,7 +124,6 @@
|
|||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
"@lezer/generator": "^1.7.1",
|
"@lezer/generator": "^1.7.1",
|
||||||
"@playwright/test": "^1.45.1",
|
"@playwright/test": "^1.45.1",
|
||||||
"@tauri-apps/cli": "==2.0.0-beta.13",
|
|
||||||
"@testing-library/jest-dom": "^5.14.1",
|
"@testing-library/jest-dom": "^5.14.1",
|
||||||
"@testing-library/react": "^15.0.2",
|
"@testing-library/react": "^15.0.2",
|
||||||
"@types/d3-force": "^3.0.10",
|
"@types/d3-force": "^3.0.10",
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { isDesktop } from './isDesktop'
|
import { isDesktop } from './isDesktop'
|
||||||
import { deserialize_files } from '../wasm-lib/pkg/wasm_lib'
|
import { deserialize_files } from '../wasm-lib/pkg/wasm_lib'
|
||||||
import { browserSaveFile } from './browserSaveFile'
|
import { browserSaveFile } from './browserSaveFile'
|
||||||
import { save } from '@tauri-apps/plugin-dialog'
|
|
||||||
import { writeFile } from '@tauri-apps/plugin-fs'
|
|
||||||
|
|
||||||
import JSZip from 'jszip'
|
import JSZip from 'jszip'
|
||||||
import ModelingAppFile from './modelingAppFile'
|
import ModelingAppFile from './modelingAppFile'
|
||||||
@ -17,7 +15,7 @@ const save_ = async (file: ModelingAppFile) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open a dialog to save the file.
|
// Open a dialog to save the file.
|
||||||
const filePath = await save({
|
const filePath = await window.electron.save({
|
||||||
defaultPath: file.name,
|
defaultPath: file.name,
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
@ -34,7 +32,7 @@ const save_ = async (file: ModelingAppFile) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write the file.
|
// Write the file.
|
||||||
await writeFile(filePath, new Uint8Array(file.contents))
|
await window.electron.writeFile(filePath, new Uint8Array(file.contents))
|
||||||
} else {
|
} else {
|
||||||
// Download the file to the user's computer.
|
// Download the file to the user's computer.
|
||||||
// Now we need to download the files to the user's downloads folder.
|
// Now we need to download the files to the user's downloads folder.
|
||||||
|
Reference in New Issue
Block a user