Open rubenandre opened 2 years ago
Describe the bug When importing a file in macos they generate a exception
To Reproduce Steps to reproduce the behavior:
Expected behavior The exam file should be loaded
Desktop (please complete the following information):
Additional context The error it's located in showFileDialog.js line 31. The following code only works on windows:
showFileDialog.js
const filename = filepaths[0].split('\\').pop()
One possible solution for this problem is create the following function
const getOs = () => { const os = ['Windows', 'Linux', 'Mac']; // add your OS values return os.find(v=>window.navigator.appVersion.indexOf(v) >= 0); }
and replace line 31 with:
const os = getOs() let filename = null if (os == 'Windows') { filename = filepaths[0].split('\\').pop() } else { filename = filepaths[0].split('/').pop() }
Describe the bug When importing a file in macos they generate a exception
To Reproduce Steps to reproduce the behavior:
Expected behavior The exam file should be loaded
Desktop (please complete the following information):
Additional context The error it's located in
showFileDialog.js
line 31. The following code only works on windows:One possible solution for this problem is create the following function
and replace line 31 with: