mirror of
https://github.com/vector-im/element-desktop.git
synced 2024-09-09 22:05:10 +00:00
Add warning dialog when custom config.json is invalid
Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
parent
7f28e3f1e2
commit
bc0e3bb317
2 changed files with 12 additions and 0 deletions
|
@ -207,6 +207,16 @@ async function setupGlobals() {
|
|||
|
||||
vectorConfig = Object.assign(vectorConfig, localConfig);
|
||||
} catch (e) {
|
||||
if (e instanceof SyntaxError) {
|
||||
dialog.showMessageBox({
|
||||
type: "error",
|
||||
title: _t("Your %(brand)s is misconfigured", { brand: vectorConfig.brand || 'Element'}),
|
||||
message: _t("Your custom %(brand)s configuration contains invalid JSON. " +
|
||||
"Please correct the problem and reopen %(brand)s.", { brand: vectorConfig.brand || 'Element'}),
|
||||
detail: e.message || "",
|
||||
});
|
||||
}
|
||||
|
||||
// Could not load local config, this is expected in most cases.
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
"Your %(brand)s is misconfigured": "Your %(brand)s is misconfigured",
|
||||
"Your custom %(brand)s configuration contains invalid JSON. Please correct the problem and reopen %(brand)s.": "Your custom %(brand)s configuration contains invalid JSON. Please correct the problem and reopen %(brand)s.",
|
||||
"Cancel": "Cancel",
|
||||
"Close Element": "Close Element",
|
||||
"Are you sure you want to quit?": "Are you sure you want to quit?",
|
||||
|
|
Loading…
Reference in a new issue