Electron (version 7.x) window crashing on ubuntu 18, 20 for showOpenDialogSync or showOpenDialog Below is my code
directorySelection = e => {
const { onCustomPathUpdate } = this.props;
const remote = window.require('electron').remote;
const openDialog = remote.dialog.showOpenDialogSync || remote.dialog.showOpenDialog;
var directory = openDialog({
properties: ['openDirectory']
});
if (directory && directory.length) {
onCustomPathUpdate(directory[0]);
}
};
<button onClick={this.directorySelection} type="button">Browse</button>
I am hosting React(16.8.4) application in Electron(7.x) window. I am using the above code for opening file explorer of ubuntu and it is crashing the application. Can anyone help to get it fixed?
The above code is working fine with Ubuntu version 16.