mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 10:03:28 +07:00
Fixes RYZEN-CONTROLLER-30 - Unable to detect malformed data in some cases.
This commit is contained in:
parent
d99511a423
commit
e6bbe74f74
@ -17,9 +17,10 @@ function preset_import() {
|
||||
const modalTextArea = document.getElementById('modal-import-preset-textarea');
|
||||
const settings = require('electron-settings');
|
||||
var currentPresets = settings.get('presets');
|
||||
var presetsToBeImported = atob(modalTextArea.value);
|
||||
|
||||
var presetsToBeImported;
|
||||
|
||||
try {
|
||||
presetsToBeImported = atob(modalTextArea.value);
|
||||
presetsToBeImported = JSON.parse(presetsToBeImported);
|
||||
} catch (e) {
|
||||
notification('danger', 'Unable to import presets, malformed data.');
|
||||
|
Loading…
Reference in New Issue
Block a user