Skip to content

Commit bf97fd6

Browse files
committed
Handle cases of no default server
1 parent 45caa8b commit bf97fd6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"Unexpected error preparing the app. See console for details.": "Unexpected error preparing the app. See console for details.",
33
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.",
4+
"Invalid configuration: no default server specified": "Invalid configuration: no default server specified",
45
"Riot Desktop on %(platformName)s": "Riot Desktop on %(platformName)s",
56
"Unknown device": "Unknown device",
67
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s",

src/vector/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,6 @@ async function verifyServerConfig() {
452452
// TODO: TravisR - Handle query string arguments for hs_url and is_url
453453
// We probably don't want to handle them unless the user is logged out though?
454454

455-
// TODO: TravisR - Handle case of no options specified whatsoever
456-
457455
const config = SdkConfig.get();
458456
let wkConfig = config['default_server_config']; // overwritten later under some conditions
459457
const serverName = config['default_server_name'];
@@ -467,6 +465,9 @@ async function verifyServerConfig() {
467465
"or default_hs_url.",
468466
));
469467
}
468+
if (incompatibleOptions.length < 1) {
469+
throw newTranslatableError(_td("Invalid configuration: no default server specified."));
470+
}
470471

471472
if (hsUrl) {
472473
console.log("Config uses a default_hs_url - constructing a default_server_config using this information");

0 commit comments

Comments
 (0)