fix: wire auto-updater to real Go backend — check, download, install via Wails bindings
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m3s

This commit is contained in:
Vantz Stockwell 2026-03-17 10:30:09 -04:00
parent 75afa70155
commit e5c69106c5

View File

@ -60,6 +60,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed, ref, onMounted } from "vue"; import { computed, ref, onMounted } from "vue";
import { Call } from "@wailsio/runtime";
import { useSessionStore } from "@/stores/session.store"; import { useSessionStore } from "@/stores/session.store";
import { useConnectionStore } from "@/stores/connection.store"; import { useConnectionStore } from "@/stores/connection.store";
@ -97,12 +98,13 @@ const connectionInfo = computed(() => {
/** Check for updates on mount. */ /** Check for updates on mount. */
onMounted(async () => { onMounted(async () => {
try { try {
// TODO: replace with Wails binding UpdateService.CheckForUpdate() const info = await Call.ByName(
// const info = await UpdateService.CheckForUpdate(); "github.com/vstockwell/wraith/internal/updater.UpdateService.CheckForUpdate"
// if (info.available) { ) as UpdateInfoData | null;
// updateAvailable.value = true; if (info && info.available) {
// updateInfo.value = info; updateAvailable.value = true;
// } updateInfo.value = info;
}
} catch { } catch {
// Silent fail update check is non-critical. // Silent fail update check is non-critical.
} }
@ -113,10 +115,14 @@ async function handleUpdate(): Promise<void> {
if (!updateInfo.value || updateState.value === "downloading") return; if (!updateInfo.value || updateState.value === "downloading") return;
updateState.value = "downloading"; updateState.value = "downloading";
try { try {
// TODO: replace with Wails bindings const path = await Call.ByName(
// const path = await UpdateService.DownloadUpdate(updateInfo.value); "github.com/vstockwell/wraith/internal/updater.UpdateService.DownloadUpdate",
// await UpdateService.ApplyUpdate(path); updateInfo.value.latestVersion
console.log("Update download triggered for", updateInfo.value.latestVersion); ) as string;
await Call.ByName(
"github.com/vstockwell/wraith/internal/updater.UpdateService.ApplyUpdate",
path
);
} catch (e) { } catch (e) {
console.error("Update failed:", e); console.error("Update failed:", e);
updateState.value = "idle"; updateState.value = "idle";