Skip to content

Commit

Permalink
Fixed top level async
Browse files Browse the repository at this point in the history
  • Loading branch information
EMcNugget committed Aug 8, 2024
1 parent b8aeb43 commit f0081c7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "d-atis-to-vatis",
"private": true,
"version": "1.5.3",
"version": "1.5.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
},
"productName": "D-ATIStovATIS",
"version": "1.5.3",
"version": "1.5.0",
"identifier": "D-ATIStovATIS",
"plugins": {
"updater": {
Expand Down
34 changes: 20 additions & 14 deletions src/views/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(update?.version ?? "Unknown");
const store = use_store();
if (update?.available) {
version.value = update.version;
}
const version = ref<string>("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,
Expand All @@ -44,11 +50,11 @@ watch(
>
<Alerts :message="message" :show="showAlert" @close="showAlert = false" />
<Update
v-if="update?.available"
v-if="showUpdate"
:show="showUpdate"
:version="version"
@close-update="showUpdate = false"
@download-and-install="updateAndRelaunch()"
@download-and-install="updateAndRelaunch"
/>
<slot />
<Settings :showModal="showSettings" @close="showSettings = !showSettings" />
Expand Down

0 comments on commit f0081c7

Please sign in to comment.