Add: Update-Dialog fuer Electron Auto-Updater
- main.js: IPC-Events an Renderer senden wenn Update bereit - main.js: install-update IPC Handler (quitAndInstall) - App.tsx: Update-Banner "Neues Update verfuegbar!" mit Restart-Button - styles.css: Update-Bar Styling passend zum Design-System Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
06ab7f523b
commit
7ef4eefc55
3 changed files with 52 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ export function registerTab(pluginName: string, component: React.FC<{ data: any
|
|||
export default function App() {
|
||||
const [connected, setConnected] = useState(false);
|
||||
const [plugins, setPlugins] = useState<PluginInfo[]>([]);
|
||||
const [updateReady, setUpdateReady] = useState(false);
|
||||
const [activeTab, setActiveTabRaw] = useState<string>(() => localStorage.getItem('hub_activeTab') ?? '');
|
||||
|
||||
const setActiveTab = (tab: string) => {
|
||||
|
|
@ -93,6 +94,13 @@ export default function App() {
|
|||
|
||||
const version = (import.meta as any).env?.VITE_APP_VERSION ?? '1.5.0';
|
||||
|
||||
// Listen for Electron auto-update events
|
||||
useEffect(() => {
|
||||
const api = (window as any).electronAPI;
|
||||
if (!api?.onUpdateReady) return;
|
||||
api.onUpdateReady(() => setUpdateReady(true));
|
||||
}, []);
|
||||
|
||||
// Tab icon mapping
|
||||
const tabIcons: Record<string, string> = {
|
||||
radio: '\u{1F30D}',
|
||||
|
|
@ -145,6 +153,15 @@ export default function App() {
|
|||
</div>
|
||||
</header>
|
||||
|
||||
{updateReady && (
|
||||
<div className="hub-update-bar">
|
||||
<span>Neues Update verfügbar!</span>
|
||||
<button onClick={() => (window as any).electronAPI?.installUpdate()}>
|
||||
Jetzt neu starten
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<main className="hub-content">
|
||||
{plugins.length === 0 ? (
|
||||
<div className="hub-empty">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue