Bugfix. Use init settings to check for test env

This commit is contained in:
JC Brand 2021-03-10 12:39:17 +01:00
parent d3ab68011a
commit 4fd848ff3e
2 changed files with 6 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import u from '@converse/headless/utils/core';
import { CONNECTION_STATUS } from '@converse/headless/shared/constants';
import { Router } from '@converse/skeletor/src/router.js';
import { TimeoutError } from '@converse/headless/shared/errors';
import { getAppSettings } from '@converse/headless/shared/settings';
import { getInitSettings } from '@converse/headless/shared/settings';
/**
@ -77,7 +77,7 @@ const _converse = {
TimeoutError: TimeoutError,
isTestEnv: () => {
return getAppSettings()['bosh_service_url'] === 'montague.lit/http-bind';
return getInitSettings()['bosh_service_url'] === 'montague.lit/http-bind';
},
/**

View File

@ -63,6 +63,10 @@ export function initAppSettings (settings) {
assignIn(app_settings, DEFAULT_SETTINGS, allowed_settings);
}
export function getInitSettings () {
return init_settings;
}
export function getAppSetting (key) {
if (Object.keys(DEFAULT_SETTINGS).includes(key)) {
return app_settings[key];