Add dialog when app is unresponsive to reload

Checks the electron event 'unresponsive' and triggers a reload / cancel
dialog. Allows all scripts to be killed, checked by default.
Also adds a warning to the terminal when noScript has been executed.
This commit is contained in:
Martin Fournier
2021-12-22 14:32:36 -05:00
parent a97d2a93cb
commit 9ce8bdd29b
2 changed files with 34 additions and 8 deletions
+2
View File
@@ -34,6 +34,7 @@ import { parse } from "acorn";
import { simple as walksimple } from "acorn-walk";
import { areFilesEqual } from "./Terminal/DirectoryHelpers";
import { Player } from "./Player";
import { Terminal } from "./Terminal";
// Netscript Ports are instantiated here
export const NetscriptPorts: IPort[] = [];
@@ -609,6 +610,7 @@ export function updateOnlineScriptTimes(numCycles = 1): void {
export function loadAllRunningScripts(): void {
const skipScriptLoad = window.location.href.toLowerCase().indexOf("?noscripts") !== -1;
if (skipScriptLoad) {
Terminal.warn('Skipped loading player scripts during startup');
console.info("Skipping the load of any scripts during startup");
}
for (const server of GetAllServers()) {