diff --git a/app/js/lib/api.js b/app/js/lib/api.js index a6f51100..414ebbbe 100644 --- a/app/js/lib/api.js +++ b/app/js/lib/api.js @@ -334,9 +334,10 @@ function post(api, request) { resolve(response.data); }) .catch(error => { - if (error && error.includes("aparapi") && error.includes("Ensure that OpenCL is in your PATH (windows) or in LD_LIBRARY_PATH (linux).")) { + var errStr = error.toString() + error.stack + if (errStr && errStr.includes("aparapi") && errStr.includes("Ensure that OpenCL is in your PATH (windows) or in LD_LIBRARY_PATH (linux).")) { - } else if (error && error.includes("aparapi")) { + } else if (errStr && errStr.includes("aparapi")) { console.error("Java process failed. If you are using GPU acceleration, try disabling it on the settings tab. Please try restarting your app and check that you've installed the correct version of Java.", api, request, error); Notifier.error("Java process failed. If you are using GPU acceleration, try disabling it on the settings tab. Please try restarting your app and check that you've installed the correct version of Java"); reject(error); diff --git a/app/js/lib/selectors.js b/app/js/lib/selectors.js index 979893eb..687906b0 100644 --- a/app/js/lib/selectors.js +++ b/app/js/lib/selectors.js @@ -27,22 +27,23 @@ module.exports = { // hideOptgroupCheckboxes: true, minimumCountSelected: 99, displayTitle: true, - displayValues: true, selectAll: false, - textTemplate: function (el) { - const val = el.html(); - const assetKey = val + "Set"; - - if (Object.keys(assetsBySet).includes(assetKey)) { - const asset = assetsBySet[assetKey]; - return `
${el.html()}
` - } - - return el.html() - }, - styler: function (row) { - return ''; - } + // textTemplate: function (el) { + // const val = el.html(); + // const enValue = el.val(); + // const fixedHtml = el.html().replace(enValue, i18next.t(enValue)) + // const assetKey = enValue + "Set"; + + // if (Object.keys(assetsBySet).includes(assetKey)) { + // const asset = assetsBySet[assetKey]; + // return `
${fixedHtml}
` + // } + + // return fixedHtml + // }, + // styler: function (row) { + // return ''; + // } }; const enhanceOptions = { maxHeight: 500, diff --git a/app/js/lib/subprocess.js b/app/js/lib/subprocess.js index c35afb01..667c70de 100644 --- a/app/js/lib/subprocess.js +++ b/app/js/lib/subprocess.js @@ -10,7 +10,7 @@ const electron = require('electron'); const ipc = electron.ipcRenderer; const { killPortProcess } = require('kill-port-process'); -const { default: i18next } = require('i18next'); +// const { default: i18next } = require('i18next'); var errors = ""; var killed = false; @@ -70,7 +70,24 @@ module.exports = { }) pid = child.pid; - console.log("Child PID: ", pid) + console.log("Child PID: ", pid, initialized) + + child.stdout.on('data', (data) => { + if (!initialized) { + initialized = true; + callback() + var str = data.toString(); + console.log(str); + } else { + + } + }); + + setInterval(() => { + if (child) { + child.stdout.write(""); + } + }, 100) child.on('close', (code) => { console.log(`Java child process exited with code ${code}`); @@ -102,17 +119,6 @@ module.exports = { errors += data.toString(); }) - child.stdout.on('data', (data) => { - if (!initialized) { - initialized = true; - callback() - var str = data.toString(); - console.log(str); - } else { - - } - }); - ipc.on('app-close', _ => { killed = true; treekill(child.pid, 'SIGTERM', () => {