mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-02-07 17:02:29 +01:00
Merge pull request #201 from aaronraimist/invalid-config
Add warning dialog when custom config.json is invalid
This commit is contained in:
commit
02d0999b18
@ -207,6 +207,16 @@ async function setupGlobals() {
|
|||||||
|
|
||||||
vectorConfig = Object.assign(vectorConfig, localConfig);
|
vectorConfig = Object.assign(vectorConfig, localConfig);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (e instanceof SyntaxError) {
|
||||||
|
dialog.showMessageBox({
|
||||||
|
type: "error",
|
||||||
|
title: `Your ${vectorConfig.brand || 'Element'} is misconfigured`,
|
||||||
|
message: `Your custom ${vectorConfig.brand || 'Element'} configuration contains invalid JSON. ` +
|
||||||
|
`Please correct the problem and reopen ${vectorConfig.brand || 'Element'}.`,
|
||||||
|
detail: e.message || "",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Could not load local config, this is expected in most cases.
|
// Could not load local config, this is expected in most cases.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user