diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index fa40e94..9915a26 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -37,5 +37,13 @@ "icons/icon.ico" ], "createUpdaterArtifacts": false + }, + "plugins": { + "updater": { + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDU4RERDQTRDMkQzQ0ZBRTIKUldUaStqd3RUTXJkV0VFU2t0ZUZ3Mm1XR2dNQ2grckZrYnlES0k3MHVnTWU5aDlXbmFqT3BjY1IK", + "endpoints": [ + "https://github.com/Corfirean/coa-server-manager/releases/latest/download/latest.json" + ] + } } } diff --git a/src/lib/selfUpdate.ts b/src/lib/selfUpdate.ts index e73bca6..6db6743 100644 --- a/src/lib/selfUpdate.ts +++ b/src/lib/selfUpdate.ts @@ -1,6 +1,6 @@ import { useSyncExternalStore } from "react"; import { getCurrentWindow } from "@tauri-apps/api/window"; -import { check, type Update } from "@tauri-apps/plugin-updater"; +import type { Update } from "@tauri-apps/plugin-updater"; import { relaunch } from "@tauri-apps/plugin-process"; /** @@ -44,27 +44,9 @@ export function setAutoUpdate(on: boolean) { listeners.forEach((l) => l()); } -/** Look for a new version. With `download` it also fetches the installer so it is ready to install on exit. */ -export async function lookForUpdate(opts: { download: boolean }): Promise { - if (state.phase === "checking" || state.phase === "downloading" || state.phase === "installing") return; - set({ phase: "checking", error: undefined, percent: null }); - try { - const u = await check(); - if (!u) { - update = null; - set({ phase: "current", version: undefined }); - return; - } - update = u; - set({ version: u.version, notes: u.body ?? undefined }); - if (!opts.download) { - set({ phase: "idle" }); - return; - } - await downloadPending(); - } catch (e) { - set({ phase: "error", error: String(e) }); - } +/** Look for a new version. Disabled in CSM Modules Preview to avoid overwriting with stable releases. */ +export async function lookForUpdate(_opts: { download: boolean }): Promise { + set({ phase: "current", version: undefined }); } async function downloadPending(): Promise {