mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 13:39:58 +01: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
@ -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: _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.
|
// 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",
|
"Cancel": "Cancel",
|
||||||
"Close Element": "Close Element",
|
"Close Element": "Close Element",
|
||||||
"Are you sure you want to quit?": "Are you sure you want to quit?",
|
"Are you sure you want to quit?": "Are you sure you want to quit?",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user