Switch ALLOWED_RENDERER_FILES variable from let to const (#7393)

This commit is contained in:
absidue 2025-05-10 14:41:20 +02:00 committed by GitHub
parent 11b6110660
commit 036b3fe0f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View File

@ -136,6 +136,15 @@ export default [
},
},
{
files: ['src/main/index.js'],
languageOptions: {
globals: {
__FREETUBE_ALLOWED_PATHS__: 'readable'
}
}
},
...eslintPluginJsonc.configs['flat/base'],
{
files: ['**/*.json'],

View File

@ -57,13 +57,12 @@ Options:
function runApp() {
/** @type {Set<string>} */
let ALLOWED_RENDERER_FILES
const ALLOWED_RENDERER_FILES = process.env.NODE_ENV === 'production'
// __FREETUBE_ALLOWED_PATHS__ is replaced by the injectAllowedPaths.mjs script
? new Set(__FREETUBE_ALLOWED_PATHS__)
: new Set()
if (process.env.NODE_ENV === 'production') {
// __FREETUBE_ALLOWED_PATHS__ is replaced by the injectAllowedPaths.mjs script
// eslint-disable-next-line no-undef
ALLOWED_RENDERER_FILES = new Set(__FREETUBE_ALLOWED_PATHS__)
protocol.registerSchemesAsPrivileged([{
scheme: 'app',
privileges: {