From 5db15802a0ed9f9b6341e18aad67e458623d783b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 2 Dec 2025 20:19:25 +0000 Subject: [PATCH] Fix navigation menu config IPC handler error Resolved ReferenceError: config is not defined in the 'get-config' IPC handler. Changes: - Modified IPC handler to read config.json directly using fs.readFileSync - Added proper error handling with try/catch block - Added fallback to send empty config if file doesn't exist or can't be read - Added console logging for debugging config transmission This fixes the JavaScript error that was displaying on screen and prevents the navigation menu from loading sites properly. --- install_kiosk_0.9.8.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/install_kiosk_0.9.8.sh b/install_kiosk_0.9.8.sh index 56e15af..c553007 100644 --- a/install_kiosk_0.9.8.sh +++ b/install_kiosk_0.9.8.sh @@ -5283,7 +5283,20 @@ function createWindow(){ }); ipcMain.on('get-config',(event)=>{ - event.sender.send('config-data',config); + try{ + if(fs.existsSync(CONFIG_FILE)){ + const data=fs.readFileSync(CONFIG_FILE,'utf8'); + const config=JSON.parse(data); + event.sender.send('config-data',config); + console.log('[NAV] Sent config data to renderer'); + }else{ + console.error('[NAV] Config file not found'); + event.sender.send('config-data',{tabs:[]}); + } + }catch(err){ + console.error('[NAV] Error reading config:',err); + event.sender.send('config-data',{tabs:[]}); + } }); ipcMain.on('navigate-to-tab',(event,tabIndex)=>{