fix: add Linux support for xdg-portal version in Electron app (#5618)

This commit is contained in:
Pragadesh-45
2025-09-24 01:53:41 +05:30
committed by GitHub
parent e6c136d2bb
commit e4f8945e89

View File

@@ -1,6 +1,7 @@
const fs = require('fs');
const path = require('path');
const isDev = require('electron-is-dev');
const os = require('os');
if (isDev) {
if(!fs.existsSync(path.join(__dirname, '../../bruno-js/src/sandbox/bundle-browser-rollup.js'))) {
@@ -21,6 +22,14 @@ if (isDev && process.env.ELECTRON_USER_DATA_PATH) {
app.setPath('userData', process.env.ELECTRON_USER_DATA_PATH);
}
// Command line switches
if (os.platform() === 'linux') {
// Use portal version 4 that supports current_folder option
// to address https://github.com/usebruno/bruno/issues/5471
// Runtime sets the default version to 3, refs https://github.com/electron/electron/pull/44426
app.commandLine.appendSwitch('xdg-portal-required-version', '4');
}
const menuTemplate = require('./app/menu-template');
const { openCollection } = require('./app/collections');
const LastOpenedCollections = require('./store/last-opened-collections');