diff --git a/package.json b/package.json index d1ed122..d9439df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macos-task-manager", - "version": "1.0.4", + "version": "1.0.5", "description": "", "type": "module", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 7c4b2b3..e88adf8 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2009,7 +2009,7 @@ dependencies = [ [[package]] name = "macos-task-manager" -version = "1.0.4" +version = "1.0.5" dependencies = [ "serde", "serde_json", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index bacb17f..584bbc8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "macos-task-manager" -version = "1.0.4" +version = "1.0.5" description = "A Tauri App" authors = ["you"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 68355cc..32b3ad2 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "NeoHtop", - "version": "1.0.4" + "version": "1.0.5" }, "tauri": { "allowlist": { diff --git a/src/lib/components/AppInfo.svelte b/src/lib/components/AppInfo.svelte index 21733e2..fd73db2 100644 --- a/src/lib/components/AppInfo.svelte +++ b/src/lib/components/AppInfo.svelte @@ -6,7 +6,9 @@ import Fa from "svelte-fa"; let version = ""; + let latestVersion = ""; let showInfo = false; + let hasUpdate = false; const ASCII_ART = ` ███╗ ██╗███████╗ ██████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ @@ -24,31 +26,55 @@ stack: ["Tauri", "Rust", "Svelte", "TypeScript"], }; + async function checkLatestVersion() { + try { + const response = await fetch( + "https://api.github.com/repos/abdenasser/neohtop/releases/latest", + ); + const data = await response.json(); + latestVersion = data.tag_name.replace("v", ""); + hasUpdate = version && latestVersion && version !== latestVersion; + } catch (error) { + console.error("Failed to check latest version:", error); + } + } + onMount(async () => { version = await getVersion(); + await checkLatestVersion(); });
{ASCII_ART}