mirror of
https://github.com/vector-im/element-desktop.git
synced 2024-09-09 22:05:10 +00: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
1 changed files with 10 additions and 0 deletions
|
@ -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…
Reference in a new issue