Add non-intrusive auto-updater
Tauri updater + process plugins. Checks Gitea Releases endpoint a few seconds after launch; on a newer signed version shows a dismissible bottom-right banner with download progress and auto-relaunch. Public signing key in tauri.conf.json; release flow documented in RELEASING.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
17
src/App.tsx
17
src/App.tsx
@ -3,6 +3,7 @@ import type { MouseEvent as ReactMouseEvent, CSSProperties } from "react";
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import { getCurrentWebview } from "@tauri-apps/api/webview";
|
||||
import ModelViewer from "./ModelViewer";
|
||||
import UpdateBanner from "./Updater";
|
||||
import "./App.css";
|
||||
import { p4, statusOf, splitPath, kindOf, fmtTime, describeFiles, leaf, saveSession, loadSession, clearSession, saveScope, loadScope, P4Info, OpenedFile, Client, Change, Session, Describe, Dir } from "./p4";
|
||||
|
||||
@ -64,8 +65,9 @@ export default function App() {
|
||||
.catch(() => setPhase("connect"));
|
||||
}, []); // eslint-disable-line
|
||||
|
||||
let content;
|
||||
if (phase === "loading")
|
||||
return (
|
||||
content = (
|
||||
<div className="win">
|
||||
<div className="titlebar" data-tauri-drag-region>
|
||||
<div className="brand" data-tauri-drag-region><div className="logo">{I.hex}</div><div className="app-name">Exbyte Depot <span>— Perforce</span></div></div>
|
||||
@ -75,14 +77,15 @@ export default function App() {
|
||||
<div className="overlay"><div className="nofile"><span className="ldr" /><span>Восстановление сессии…</span></div></div>
|
||||
</div>
|
||||
);
|
||||
|
||||
if (phase === "connect")
|
||||
return <Connect light={light} toggleTheme={toggleTheme} initial={saved}
|
||||
else if (phase === "connect")
|
||||
content = <Connect light={light} toggleTheme={toggleTheme} initial={saved}
|
||||
onDone={(i, s) => { saveSession(s); setInfo(i); setSession(s); setPhase("main"); }} />;
|
||||
else
|
||||
content = <Workbench info={info} session={session} light={light} toggleTheme={toggleTheme}
|
||||
onInfo={setInfo} onSession={(s) => { setSession(s); saveSession(s); }}
|
||||
onDisconnect={() => { p4.disconnect(); clearSession(); setInfo(null); setSession(null); setPhase("connect"); }} />;
|
||||
|
||||
return <Workbench info={info} session={session} light={light} toggleTheme={toggleTheme}
|
||||
onInfo={setInfo} onSession={(s) => { setSession(s); saveSession(s); }}
|
||||
onDisconnect={() => { p4.disconnect(); clearSession(); setInfo(null); setSession(null); setPhase("connect"); }} />;
|
||||
return <>{content}<UpdateBanner /></>;
|
||||
}
|
||||
|
||||
/* ---------------- connect screen ---------------- */
|
||||
|
||||
Reference in New Issue
Block a user