Skip to content

Commit 9a0b2be

Browse files
committed
Fix "enable" checks
1 parent b8ec150 commit 9a0b2be

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

actions/aaa_mods_api.mod.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ module.exports = {
194194
},
195195
async callNPM(command, args, opts) { // TODO Redundant
196196
const apiSettings = await this.getAPISettings();
197-
const nodeDir = apiSettings.enableNodePath ? normalize(apiSettings.nodePath) : "node";
198-
const npmDir = apiSettings.enableNpmPath ? normalize(apiSettings.npmPath) : "npm";
197+
const nodeDir = apiSettings?.enableNodePath === "true" ? normalize(apiSettings.nodePath) : "node";
198+
const npmDir = apiSettings?.enableNpmPath === "true" ? normalize(apiSettings.npmPath) : "npm";
199199

200200
const spawnArgs = [
201201
command,
@@ -330,8 +330,8 @@ module.exports = {
330330
const apiSettings = await this.getAPISettings();
331331
/** @type {string} */
332332
const dbmDir = await execInMainElectronWindow("DBM.mainLoc");
333-
const nodeDir = apiSettings.enableNodePath ? normalize(apiSettings.nodePath) : join(dbmDir, "resources", "app", "nodejs");
334-
const npmDir = apiSettings.enableNpmPath ? normalize(apiSettings.npmPath) : join(dbmDir, "resources", "app", "nodejs", "node_modules", "npm", "bin");
333+
const nodeDir = apiSettings?.enableNodePath === "true" ? normalize(apiSettings.nodePath) : join(dbmDir, "resources", "app", "nodejs");
334+
const npmDir = apiSettings?.enableNpmPath === "true" ? normalize(apiSettings.npmPath) : join(dbmDir, "resources", "app", "nodejs", "node_modules", "npm", "bin");
335335

336336
const spawnArgs = [
337337
command,

extensions/env_settings_provider.mod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ module.exports = {
4848
<div style="padding: 8px">
4949
<div style="width: 35%">
5050
<select id="enable" class="round" onchange="glob.onEnableChanged(this)">
51-
<option value="true" ${data.enable ? "selected" : ""}>Enable</option>
52-
<option value="false" ${data.enable ? "" : "selected"}>Disable</option>
51+
<option value="true" ${data.enable === "true" ? "selected" : ""}>Enable</option>
52+
<option value="false" ${data.enable === "true" ? "" : "selected"}>Disable</option>
5353
</select>
5454
</div>
5555
<br>

extensions/mods_api_settings.mod.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ module.exports = {
4747
<div style="width: 35%">
4848
<span class="dbminputlabel">Custom Node.js Path</span><br>
4949
<select id="enableNodePath" class="round" onchange="glob.onEnableNodePathChanged(this)">
50-
<option value="true" ${data.enableNodePath ? "selected" : ""}>Enable</option>
51-
<option value="false" ${data.enableNodePath ? "" : "selected"}>Disable</option>
50+
<option value="true" ${data.enableNodePath === "true" ? "selected" : ""}>Enable</option>
51+
<option value="false" ${data.enableNodePath === "true" ? "" : "selected"}>Disable</option>
5252
</select>
5353
</div>
5454
<br>
@@ -60,8 +60,8 @@ module.exports = {
6060
<div style="width: 35%">
6161
<span class="dbminputlabel">Custom NPM Path</span><br>
6262
<select id="enableNpmPath" class="round" onchange="glob.onEnableNpmPathChanged(this)">
63-
<option value="true" ${data.enableNpmPath ? "selected" : ""}>Enable</option>
64-
<option value="false" ${data.enableNpmPath ? "" : "selected"}>Disable</option>
63+
<option value="true" ${data.enableNpmPath === "true" ? "selected" : ""}>Enable</option>
64+
<option value="false" ${data.enableNpmPath === "true" ? "" : "selected"}>Disable</option>
6565
</select>
6666
</div>
6767
<br>

0 commit comments

Comments
 (0)