Skip to content

Commit c289cb8

Browse files
committed
remove beta
1 parent 8001bbc commit c289cb8

1 file changed

Lines changed: 41 additions & 68 deletions

File tree

src/main.ts

Lines changed: 41 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ app.commandLine.appendSwitch('no-sandbox');
1010

1111
require("dotenv").config();
1212

13-
const isDev = require("electron-is-dev");
14-
1513
const appVersion = app.getVersion();
1614
const isBeta = appVersion.includes("-beta");
1715

@@ -21,16 +19,10 @@ console.log(`[Launcher] É beta? ${isBeta}`);
2119
autoUpdater.logger = console;
2220
autoUpdater.autoDownload = false;
2321
autoUpdater.allowDowngrade = false;
22+
autoUpdater.allowPrerelease = false;
23+
autoUpdater.channel = "latest";
2424

25-
if (isBeta) {
26-
console.log("[AutoUpdater] Versão beta detectada. Permitindo prereleases.");
27-
autoUpdater.allowPrerelease = true;
28-
autoUpdater.channel = "beta";
29-
} else {
30-
console.log("[AutoUpdater] Versão de produção detectada.");
31-
autoUpdater.allowPrerelease = false;
32-
autoUpdater.channel = "latest";
33-
}
25+
console.log("[AutoUpdater] Versão de produção detectada.");
3426

3527
const gameManager = new GameManager();
3628

@@ -83,13 +75,6 @@ autoUpdater.on("error", (err) => {
8375
console.error("[AutoUpdater] ❌ ERRO:", err);
8476
console.error("[AutoUpdater] Stack:", err.stack);
8577
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
86-
87-
if (!isDev) {
88-
dialog.showErrorBox(
89-
"Erro na Atualização",
90-
`Não foi possível verificar atualizações: ${err.message}`
91-
);
92-
}
9378
});
9479

9580
autoUpdater.on("download-progress", (progressObj) => {
@@ -156,9 +141,7 @@ function createWindow(gameType?: GameType) {
156141
});
157142

158143
if (!gameType) {
159-
const selectorPath = isDev
160-
? path.join(__dirname, "pages/game-selector.html")
161-
: path.join(__dirname, "pages", "game-selector.html");
144+
const selectorPath = path.join(__dirname, "pages", "game-selector.html");
162145

163146
console.log(`[Launcher] Carregando seletor de jogos de: ${selectorPath}`);
164147
mainWindow.loadFile(selectorPath).catch(error => {
@@ -311,14 +294,14 @@ app.whenReady().then(() => {
311294

312295
if (oldState !== newState) {
313296
const response = await dialog.showMessageBox({
314-
type: "info",
297+
type: "info",
315298
title: "Mudança de FPS",
316-
message: newState
317-
? "FPS ilimitado ativado! O launcher precisa ser reiniciado."
299+
message: newState
300+
? "FPS ilimitado ativado! O launcher precisa ser reiniciado."
318301
: "FPS limitado reativado! O launcher precisa ser reiniciado.",
319-
detail: "Deseja reiniciar agora?",
320-
buttons: ["Reiniciar", "Depois"],
321-
defaultId: 0,
302+
detail: "Deseja reiniciar agora?",
303+
buttons: ["Reiniciar", "Depois"],
304+
defaultId: 0,
322305
cancelId: 1
323306
});
324307

@@ -328,7 +311,7 @@ app.whenReady().then(() => {
328311
app.quit();
329312
}
330313
}
331-
314+
332315
return newState;
333316
});
334317

@@ -342,14 +325,14 @@ app.whenReady().then(() => {
342325

343326
if (needsAppRestart && wasUnlimited) {
344327
const response = await dialog.showMessageBox({
345-
type: "info",
328+
type: "info",
346329
title: "Limite de FPS Configurado",
347-
message: newLimit
348-
? `FPS limitado a ${newLimit}! O launcher precisa ser reiniciado.`
330+
message: newLimit
331+
? `FPS limitado a ${newLimit}! O launcher precisa ser reiniciado.`
349332
: "Modo padrão ativado! O launcher precisa ser reiniciado.",
350-
detail: "Deseja reiniciar agora?",
351-
buttons: ["Reiniciar", "Depois"],
352-
defaultId: 0,
333+
detail: "Deseja reiniciar agora?",
334+
buttons: ["Reiniciar", "Depois"],
335+
defaultId: 0,
353336
cancelId: 1
354337
});
355338

@@ -360,14 +343,14 @@ app.whenReady().then(() => {
360343
}
361344
} else if (mainWindow) {
362345
const response = await dialog.showMessageBox({
363-
type: "info",
346+
type: "info",
364347
title: "Limite de FPS Configurado",
365-
message: newLimit
366-
? `FPS limitado a ${newLimit}! A página precisa ser recarregada.`
348+
message: newLimit
349+
? `FPS limitado a ${newLimit}! A página precisa ser recarregada.`
367350
: "Modo padrão ativado! A página precisa ser recarregada.",
368-
detail: "Deseja recarregar agora?",
369-
buttons: ["Recarregar", "Depois"],
370-
defaultId: 0,
351+
detail: "Deseja recarregar agora?",
352+
buttons: ["Recarregar", "Depois"],
353+
defaultId: 0,
371354
cancelId: 1
372355
});
373356

@@ -392,8 +375,8 @@ app.whenReady().then(() => {
392375

393376
ipcMain.handle("getFpsConfig", () => {
394377
const handler = gameManager.getHandler(GameType.BONKIO);
395-
return handler instanceof BonkHandler
396-
? handler.getFpsConfig()
378+
return handler instanceof BonkHandler
379+
? handler.getFpsConfig()
397380
: { unlimitedFPS: false, fpsLimit: null, isDefault: true };
398381
});
399382

@@ -491,13 +474,7 @@ app.whenReady().then(() => {
491474
}
492475
});
493476

494-
let selectorPath: string;
495-
496-
if (isDev) {
497-
selectorPath = path.join(__dirname, "pages/join-room.html");
498-
} else {
499-
selectorPath = path.join(__dirname, "pages", "join-room.html");
500-
}
477+
let selectorPath = path.join(__dirname, "pages", "join-room.html");
501478

502479
console.log('[JoinWindow] Carregando:', selectorPath);
503480
console.log('[JoinWindow] Preload path:', path.join(__dirname, "preload.js"));
@@ -606,25 +583,21 @@ app.whenReady().then(() => {
606583
`).catch(error => console.error('[Notification] Erro:', error));
607584
});
608585

609-
if (!isDev) {
610-
console.log("[AutoUpdater] Verificando atualizações na inicialização...");
611-
setTimeout(() => {
612-
autoUpdater.checkForUpdates()
613-
.then(result => {
614-
console.log("[AutoUpdater] Resultado da verificação:", result);
615-
})
616-
.catch(error => {
617-
console.error("[AutoUpdater] Erro ao verificar:", error);
618-
});
619-
}, 3000);
620-
621-
setInterval(() => {
622-
console.log("[AutoUpdater] Verificação periódica iniciada...");
623-
autoUpdater.checkForUpdates();
624-
}, 10 * 60 * 1000);
625-
} else {
626-
console.log("[AutoUpdater] Modo desenvolvimento - AutoUpdater desabilitado");
627-
}
586+
console.log("[AutoUpdater] Verificando atualizações na inicialização...");
587+
setTimeout(() => {
588+
autoUpdater.checkForUpdates()
589+
.then(result => {
590+
console.log("[AutoUpdater] Resultado da verificação:", result);
591+
})
592+
.catch(error => {
593+
console.error("[AutoUpdater] Erro ao verificar:", error);
594+
});
595+
}, 3000);
596+
597+
setInterval(() => {
598+
console.log("[AutoUpdater] Verificação periódica iniciada...");
599+
autoUpdater.checkForUpdates();
600+
}, 10 * 60 * 1000);
628601

629602
app.on("activate", () => {
630603
if (BrowserWindow.getAllWindows().length === 0) createWindow();

0 commit comments

Comments
 (0)