Upload via GUI (202 Dateien)

This commit is contained in:
2026-10-11 07:05:46 +00:00
parent 1e5d8b5b95
commit 67337c5b1e
3 changed files with 41 additions and 1 deletions
+19 -1
View File
@@ -212,6 +212,7 @@ const POPOUT_SPEC = {
stats: { title: 'AeroMC – Spielzeit-Statistik', width: 640, height: 560, minWidth: 520, minHeight: 420 },
};
const POPOUT_DEFAULT = { title: 'AeroMC', width: 860, height: 680, minWidth: 640, minHeight: 480 };
let betaStand = false; // zuletzt bekannter Stand von "An der Beta teilnehmen"
let pendingUpdateInfo = null; // letztes Ergebnis von update:check/checkForUpdate, für Update-Popup
// Ergebnis der letzten Update-Suche (auch "läuft gerade" oder Fehler) – Fenster, die
// erst später aufgehen (z. B. Einstellungen → Info), holen es sich hierüber ab
@@ -223,7 +224,7 @@ async function pruefeAufUpdates() {
letzterUpdateCheck = { checking: true };
broadcast('update:checked', letzterUpdateCheck);
try {
const info = await updater.checkForUpdate(app.getVersion());
const info = await updater.checkForUpdate(app.getVersion(), { beta: store.getSettings().betaTeilnahme === true });
pendingUpdateInfo = info;
letzterUpdateCheck = info;
} catch (err) {
@@ -1073,6 +1074,18 @@ app.whenReady().then(() => {
decrypt: (b) => safeStorage.decryptString(Buffer.from(b, 'base64')),
};
auth.init(app.getPath('userData'), tresor);
// Beta-Teilnahme: Wer eine Vorabfassung von Hand installiert, nimmt ab da teil
// (einmalig beim Wechsel von einer fertigen auf eine Vorabfassung – danach
// gilt allein der Schalter in den Optionen, auch wenn er wieder aus ist).
{
const vorab = updater.istVorabVersion(app.getVersion());
const e = store.getSettings();
const neu = {};
if (vorab && !e.letzteVersionVorab && e.betaTeilnahme !== true) neu.betaTeilnahme = true;
if (!!e.letzteVersionVorab !== vorab) neu.letzteVersionVorab = vorab;
if (Object.keys(neu).length) store.saveSettings(neu);
betaStand = store.getSettings().betaTeilnahme === true;
}
try { integritaet.init(app.getPath('userData'), tresor, store); } catch (err) { console.warn('Manipulationsschutz:', err.message); }
setTimeout(() => { pruefeAlleInstanzen().catch(() => {}); }, 8000);
// Proxy-Passwort und API-Schlüssel ebenso (siehe store.setzeTresor)
@@ -1195,6 +1208,11 @@ ipcMain.handle('settings:save', (_e, patch) => {
applyProxy(s);
if (patch && Object.prototype.hasOwnProperty.call(patch, 'autostart')) applyAutostart(s.autostart);
if (patch && Object.prototype.hasOwnProperty.call(patch, 'discordClientId')) discordpresence.configure(s);
// Beta-Teilnahme umgeschaltet -> gleich neu nach Updates suchen
if (patch && Object.prototype.hasOwnProperty.call(patch, 'betaTeilnahme') && !!patch.betaTeilnahme !== betaStand) {
betaStand = !!patch.betaTeilnahme;
pruefeAufUpdates().then((info) => { if (info.available) broadcast('update:available', info); }).catch(() => {});
}
if (patch && Object.prototype.hasOwnProperty.call(patch, 'friendsEnabled')) {
aktualisiereFreundeTastenkuerzel();
aktualisiereAnfragenZahl().catch(() => {});