From 4c6a51429528501bd253083cdc215a31243afe11 Mon Sep 17 00:00:00 2001 From: Thomas ANTOINE Date: Wed, 1 Nov 2023 02:02:18 +0900 Subject: [PATCH] Fix opening challenges --- js/render_logic/render.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/render_logic/render.js b/js/render_logic/render.js index d0d379c..1b4b931 100644 --- a/js/render_logic/render.js +++ b/js/render_logic/render.js @@ -244,11 +244,14 @@ function unblock_buttons(){ pause_button.disabled = false; } +const ff = require('node-find-folder'); +var ff_result = new ff('challenges'); +console.log(ff_result) function switch_to_challenge_mode(file){ //open json let json; try{ - json = JSON.parse(fs.readFileSync('./challenges/'+file)); + json = JSON.parse(fs.readFileSync(ff_result[0]+"/"+file)); }catch{ dialog.showErrorBox("Error", "Can't open challenge file, either it doesn't exist or it's not a valid json file."); throw "Can't open challenge file";