diff --git a/gui/src-tauri/Cargo.toml b/gui/src-tauri/Cargo.toml index f4ca631..81aef71 100644 --- a/gui/src-tauri/Cargo.toml +++ b/gui/src-tauri/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" tauri-build = { version = "1.2", features = [] } [dependencies] -tauri = { version = "1.2", features = ["fs-all", "path-all", "shell-execute", "shell-open", "shell-sidecar", "updater", "window-all"] } +tauri = { version = "1.2", features = ["fs-all", "path-all", "process-relaunch", "shell-execute", "shell-open", "shell-sidecar", "updater", "window-all"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio = { version = "1.0", features = ["time"] } diff --git a/gui/src-tauri/tauri.conf.json b/gui/src-tauri/tauri.conf.json index 0dfdc57..a45fc1c 100644 --- a/gui/src-tauri/tauri.conf.json +++ b/gui/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "s3si-ts", - "version": "0.3.3" + "version": "0.3.2" }, "tauri": { "allowlist": { @@ -47,6 +47,10 @@ }, "path": { "all": true + }, + "process": { + "all": false, + "relaunch": true } }, "bundle": { diff --git a/gui/src/components/CheckUpdate.tsx b/gui/src/components/CheckUpdate.tsx new file mode 100644 index 0000000..f60c4fb --- /dev/null +++ b/gui/src/components/CheckUpdate.tsx @@ -0,0 +1,16 @@ +import { ReactNode } from "react"; +import { checkUpdate } from '@tauri-apps/api/updater' + +export const CheckUpdate: React.FC<{ className?: string, children?: ReactNode }> = ({ className, children }) => { + const onClick = async () => { + try { + await checkUpdate() + } catch (error) { + console.log(error) + } + } + + return <> + + >; +} diff --git a/gui/src/pages/Home.tsx b/gui/src/pages/Home.tsx index aed01bf..d4b9197 100644 --- a/gui/src/pages/Home.tsx +++ b/gui/src/pages/Home.tsx @@ -1,3 +1,4 @@ +import { CheckUpdate } from 'components/CheckUpdate'; import { ErrorContent } from 'components/ErrorContent'; import { Loading } from 'components/Loading'; import { STAT_INK } from 'constant'; @@ -33,6 +34,7 @@ export const Home: React.FC = () => {