From 322cccd55c228f3a4485d084219ddb2b2af0436c Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on Debian Linux)" <rob@synchro.net> Date: Sun, 1 Dec 2024 15:46:43 -0800 Subject: [PATCH] Don't call uifc.bail() repeatedly Since this script already sets an on_exit() handler to call uifc.bail() it doesn't have to call it again (technically, before) in the "Done" block. This results in "UIFC is unitialized" error displayed, as reported by Fernando Toledo. Fixing issue #830 Set WIN_ESC (remains active, but greyed when ESC key pressed) mode flag on main menu while we're here. That looks better. --- exec/freqitcfg.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exec/freqitcfg.js b/exec/freqitcfg.js index d9c95e6a16..6d3959fd78 100644 --- a/exec/freqitcfg.js +++ b/exec/freqitcfg.js @@ -187,7 +187,7 @@ function main() js.on_exit("uifc.bail()"); while (cmd >= 0) { opts = ["Dirs...", "Secure Dirs...", format("Max Files (%d)", cfg.maxfiles), "Magic Names..."]; - cmd = uifc.list(WIN_ACT|WIN_ORG|WIN_MID, "FREQIT Options", opts, ctx); + cmd = uifc.list(WIN_ACT|WIN_ORG|WIN_MID|WIN_ESC, "FREQIT Options", opts, ctx); switch(cmd) { case 0: // Dirs edit_dirs(cfg.dirs); @@ -206,11 +206,9 @@ function main() case -1: // Done switch(uifc.list(WIN_ACT|WIN_MID, 'Save File', ['Yes', 'No'])) { case 0: - uifc.bail(); cfg.save(); break; case 1: - uifc.bail(); break; case -1: cmd = 0; -- GitLab