diff --git a/electron/main.js b/electron/main.js index 4c9477dfe..23b0c376f 100644 --- a/electron/main.js +++ b/electron/main.js @@ -72,23 +72,6 @@ function setStopProcessHandler(app, window) { log.error(error); } - // This may no longer be needed due to the return of action: deny in gameWindow.js setWindowOpenHandler. - // Nothing currently sets the app_playerOpenedExternalLink flag. See utils.js openExternal comment for more info. - // ------- - // Because of a steam limitation, if the player has launched an external browser, - // steam will keep displaying the game as "Running" in their UI as long as the browser is up. - // So we'll alert the player to close their browser. - if (global.app_playerOpenedExternalLink) { - await dialog.showMessageBox({ - title: "Bitburner", - message: "You may have to close your browser to properly exit the game.", - detail: - 'Steam will keep tracking Bitburner as "Running" if any process started within the game is still running.' + - " This includes launching an external link, which opens up your browser.", - type: "warning", - buttons: ["OK"], - }); - } // We'll try to execute javascript on the page to see if we're stuck let canRunJS = false; window.webContents.executeJavaScript("window.stop(); document.close()", true).then(() => (canRunJS = true)); diff --git a/electron/storage.js b/electron/storage.js index 56dd76b7e..11a94f2a1 100644 --- a/electron/storage.js +++ b/electron/storage.js @@ -58,12 +58,10 @@ async function prepareFolders(...folders) { for (const folder of folders) { try { // Making sure the folder exists - // eslint-disable-next-line no-await-in-loop await fs.stat(folder); } catch (error) { if (error.code === "ENOENT") { log.warn(`'${folder}' not found, creating it...`); - // eslint-disable-next-line no-await-in-loop await fs.mkdir(folder); } else { log.error(error); @@ -250,13 +248,11 @@ async function saveGameToDisk(window, saveData) { const fileToRemove = oldestFiles.shift(); log.debug(`Over Quota -> Removing "${fileToRemove}"`); try { - // eslint-disable-next-line no-await-in-loop await fs.unlink(fileToRemove); } catch (error) { log.error(error); } - // eslint-disable-next-line no-await-in-loop saveFolderSizeBytes = await getFolderSizeInBytes(currentFolder); log.debug(`Save Folder: ${saveFolderSizeBytes} bytes`); log.debug( diff --git a/electron/utils.js b/electron/utils.js index 3913151f5..0548024de 100644 --- a/electron/utils.js +++ b/electron/utils.js @@ -87,14 +87,6 @@ async function writeToast(window, message, type = "info", duration = 2000) { await window.webContents.executeJavaScript(`window.appNotifier.toast("${message}", "${type}", ${duration});`, true); } -// This may no longer be needed due to the return of { action: "deny" } in gameWindow.js setWindowOpenHandler. -// Currently this is unused so that this can be tested. If the issue no longer exists, this util will be removed. -// Otherwise, its use will be reimplemented. -function openExternal(url) { - shell.openExternal(url); - global.app_playerOpenedExternalLink = true; -} - function getZoomFactor() { const configZoom = config.get("zoom", 1); return configZoom; @@ -115,7 +107,6 @@ module.exports = { exportSave, attachUnresponsiveAppHandler, detachUnresponsiveAppHandler, - openExternal, writeTerminal, writeToast, getZoomFactor,