diff --git a/Changelog.md b/Changelog.md index cfb392cda..2d7d8505f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,15 @@ every new version is a new major version. - `openFile` export. +### Changed + +- Updated `es6` -> `es2021` in eslint config `env`. + +### Fixed + +- Make new `isVerboseLogging` persistent setting get/set compatible with Main + thread code (by using `globalThis` instead of `window`). + ## 148.0.0 - 2024-01-16 ### Added diff --git a/config/eslintrc.js b/config/eslintrc.js index f3df58f2c..6faa50437 100644 --- a/config/eslintrc.js +++ b/config/eslintrc.js @@ -179,7 +179,7 @@ module.exports = { 'md', ], env: { - es6: true, + es2021: true, browser: true, node: true, jasmine: true, diff --git a/src/utils/persistentStore.ts b/src/utils/persistentStore.ts index f9b86ad7c..72fa1ffbc 100644 --- a/src/utils/persistentStore.ts +++ b/src/utils/persistentStore.ts @@ -189,9 +189,9 @@ export const getIsLoggingVerbose = () => ); const resetIsLoggingVerbose = () => persistIsLoggingVerbose(false); -window.addEventListener('beforeunload', resetIsLoggingVerbose); +globalThis.addEventListener?.('beforeunload', resetIsLoggingVerbose); export const doNotResetVerboseLogginOnRestart = () => - window.removeEventListener('beforeunload', resetIsLoggingVerbose); + globalThis.removeEventListener?.('beforeunload', resetIsLoggingVerbose); export const getPersistedLogVisible = () => getAppSpecificStore().get(`isLogVisible`);