feat(desktop): tray + lancement au login + auto-update (C5)
tray.ts : icône de barre système (Ouvrir, bascule « Launch at login », Quitter). autostart.ts : login items (Windows/macOS) + fichier ~/.config/autostart/*.desktop (Linux). updater.ts : electron-updater (provider generic -> release Gitea), no-op en dev, actif Windows/Linux. main.ts : fermeture de fenêtre = réduction dans le tray, quit explicite via tray/menu, arrêt propre du daemon avant sortie. icon.png ajouté aux extraResources (tray en packagé). Vérifié : typecheck contre l'API Electron + electron-updater, bundle esbuild.
This commit is contained in:
13
packages/desktop/src/main/updater.ts
Normal file
13
packages/desktop/src/main/updater.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { app } from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
|
||||
// Vérifie les mises à jour (provider generic -> assets de release Gitea, cf. electron-builder.yml).
|
||||
// No-op en dev (pas de app-update.yml). Auto-update effectif : Windows (nsis) + Linux (AppImage) ;
|
||||
// macOS reste manuel tant que l'app n'est pas signée.
|
||||
export function initUpdater(): void {
|
||||
if (!app.isPackaged) return;
|
||||
autoUpdater.autoDownload = true;
|
||||
void autoUpdater.checkForUpdatesAndNotify().catch(() => {
|
||||
/* hors ligne / pas de release publiée : silencieux */
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user