diff --git a/CHANGELOG.md b/CHANGELOG.md index ec9d70e2e2..f19a24d6c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@
![Bug Fixes](/docs/assets/tags/bug_fixes.svg) +- [Fix some internal settings not being applied correctly in the IDE][1536]. + Some arguments were not passed correctly to the IDE leading to erroneous + behaviour in the electron app. This is now fixed. + #### Visual Environment #### EnsoGL (rendering engine) @@ -28,6 +32,7 @@ you can find their release notes [here](https://github.com/enso-org/enso/blob/main/RELEASES.md). [1511]: https://github.com/enso-org/ide/pull/1511 +[1511]: https://github.com/enso-org/ide/pull/1536 [1531]: https://github.com/enso-org/ide/pull/1531
diff --git a/src/js/lib/content/src/index.js b/src/js/lib/content/src/index.js index 48b8b6a8ea..bd239b9d05 100644 --- a/src/js/lib/content/src/index.js +++ b/src/js/lib/content/src/index.js @@ -7,6 +7,7 @@ import * as html_utils from 'enso-studio-common/src/html_utils' import * as animation from 'enso-studio-common/src/animation' import * as globalConfig from '../../../../config.yaml' import cfg from '../../../config' +import assert from "assert"; @@ -438,6 +439,36 @@ function ok(value) { return value !== null && value !== undefined } +/// Check whether the value is a string with value `"true"`/`"false"`, if so, return the +// appropriate boolean instead. Otherwise, return the original value. +function parseBooleanOrLeaveAsIs(value) { + if (value === "true"){ + return true + } + if (value === "false"){ + return false + } + return value +} + +/// Turn all values that have a boolean in string representation (`"true"`/`"false"`) into actual +/// booleans (`true/`false``). +function parseAllBooleans(config) { + for (const key in config) { + config[key] = parseBooleanOrLeaveAsIs(config[key]) + } +} + +function initLogging(config) { + assert(typeof config.no_data_gathering == "boolean") + if (config.no_data_gathering ) { + API.remoteLog = function (_event, _data) {} + } else { + let logger = new MixpanelLogger + API.remoteLog = function (event,data) {logger.log(event,data)} + } +} + /// Main entry point. Loads WASM, initializes it, chooses the scene to run. API.main = async function (inputConfig) { let defaultConfig = { @@ -451,14 +482,10 @@ API.main = async function (inputConfig) { let urlParams = new URLSearchParams(window.location.search); let urlConfig = Object.fromEntries(urlParams.entries()) let config = Object.assign(defaultConfig,inputConfig,urlConfig) + parseAllBooleans(config) API[globalConfig.windowAppScopeConfigName] = config - if (config.no_data_gathering) { - API.remoteLog = function (_event, _data) {} - } else { - let logger = new MixpanelLogger - API.remoteLog = function (event,data) {logger.log(event,data)} - } + initLogging(config) window.setInterval(() =>{API.remoteLog("alive");}, ALIVE_LOG_INTERVAL) //Build data injected during the build process. See `webpack.config.js` for the source.