diff --git a/package.json b/package.json index b9632ea..7b48e67 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "d-atis-to-vatis", "private": true, - "version": "1.5.3", + "version": "1.5.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 13203e7..cd43dda 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "D-ATIS-to-vATIS" -version = "1.5.3" +version = "1.5.0" dependencies = [ "log", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 28027e0..a927d68 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "D-ATIS-to-vATIS" -version = "1.5.3" +version = "1.5.0" description = "Converts real world FAA D-ATIS's to vATIS profiles" authors = ["you"] license = "MIT" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2263906..88061f0 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -44,7 +44,7 @@ } }, "productName": "D-ATIStovATIS", - "version": "1.5.3", + "version": "1.5.0", "identifier": "D-ATIStovATIS", "plugins": { "updater": { diff --git a/src/views/Layout.vue b/src/views/Layout.vue index f01c8db..48f6777 100644 --- a/src/views/Layout.vue +++ b/src/views/Layout.vue @@ -2,32 +2,38 @@ import Alerts from "../components/Alerts.vue"; import Settings from "../components/Settings.vue"; import Update from "../components/Update.vue"; -import { computed, ref, watch } from "vue"; +import { computed, ref, watch, onMounted } from "vue"; import { use_store } from "../lib/stores"; import { router } from "../lib/router"; import { check } from "@tauri-apps/plugin-updater"; import { relaunch } from "@tauri-apps/plugin-process"; -const store = use_store(); - -const update = await check(); -const version = ref(update?.version ?? "Unknown"); +const store = use_store(); -if (update?.available) { - version.value = update.version; -} +const version = ref("Unknown"); +const showUpdate = ref(false); const updateAndRelaunch = async () => { - update?.downloadAndInstall().then(() => { - relaunch(); - }); + const update = await check(); + if (update?.available) { + update.downloadAndInstall().then(() => { + relaunch(); + }); + } }; +onMounted(async () => { + const update = await check(); + if (update?.available) { + version.value = update.version; + showUpdate.value = true; + } +}); + const message = computed(() => store.get_message()); const localTheme = computed(() => store.get_theme()); const showAlert = ref(false); const showSettings = ref(false); -const showUpdate = ref(update?.available ?? false); watch( () => message.value, @@ -44,11 +50,11 @@ watch( >