Skip to content

Commit d37fc69

Browse files
committed
Merge tag 'v1.9.3' into sc
* Convert the "Cryptography" settings panel to an HTML table to assist screen reader users. ([\element-hq#6968](matrix-org/matrix-react-sdk#6968)). Contributed by [andybalaam](https://github.com/andybalaam). * Swap order of private space creation and tweak copy ([\element-hq#6967](matrix-org/matrix-react-sdk#6967)). Fixes element-hq#18768 and element-hq#18768. * Add spacing to Room settings - Notifications subsection ([\#6962](matrix-org/matrix-react-sdk#6962)). Contributed by [CicadaCinema](https://github.com/CicadaCinema). * Use HTML tables for some tabular user interface areas, to assist with screen reader use ([\element-hq#6955](matrix-org/matrix-react-sdk#6955)). Contributed by [andybalaam](https://github.com/andybalaam). * Fix space invite edge cases ([\element-hq#6884](matrix-org/matrix-react-sdk#6884)). Fixes element-hq#19010 element-hq#17345 and element-hq#19010. * Allow options to cascade kicks/bans throughout spaces ([\element-hq#6829](matrix-org/matrix-react-sdk#6829)). Fixes element-hq#18969 and element-hq#18969. * Make public space alias field mandatory again ([\element-hq#6921](matrix-org/matrix-react-sdk#6921)). Fixes element-hq#19003 and element-hq#19003. * Add progress bar to restricted room upgrade dialog ([\element-hq#6919](matrix-org/matrix-react-sdk#6919)). Fixes element-hq#19146 and element-hq#19146. * Add customisation point for visibility of invites and room creation ([\element-hq#6922](matrix-org/matrix-react-sdk#6922)). Fixes element-hq#19331 and element-hq#19331. * Inhibit `Unable to get validated threepid` error during UIA ([\element-hq#6928](matrix-org/matrix-react-sdk#6928)). Fixes element-hq#18883 and element-hq#18883. * Tweak room list skeleton UI height and behaviour ([\element-hq#6926](matrix-org/matrix-react-sdk#6926)). Fixes element-hq#18231 element-hq#16581 and element-hq#18231. * If public room creation fails, retry without publishing it ([\#6872](matrix-org/matrix-react-sdk#6872)). Fixes element-hq#19194 and element-hq#19194. Contributed by [AndrewFerr](https://github.com/AndrewFerr). * Iterate invite your teammates to Space view ([\element-hq#6925](matrix-org/matrix-react-sdk#6925)). Fixes element-hq#18772 and element-hq#18772. * Make placeholder more grey when no input ([\element-hq#6840](matrix-org/matrix-react-sdk#6840)). Fixes element-hq#17243 and element-hq#17243. Contributed by [wlach](https://github.com/wlach). * Respect tombstones in locally known rooms for Space children ([\element-hq#6906](matrix-org/matrix-react-sdk#6906)). Fixes element-hq#19246 element-hq#19256 and element-hq#19246. * Improve emoji shortcodes generated from annotations ([\element-hq#6907](matrix-org/matrix-react-sdk#6907)). Fixes element-hq#19304 and element-hq#19304. * Hide kick & ban options in UserInfo when looking at own profile ([\element-hq#6911](matrix-org/matrix-react-sdk#6911)). Fixes element-hq#19066 and element-hq#19066. * Add progress bar to Community to Space migration tool ([\element-hq#6887](matrix-org/matrix-react-sdk#6887)). Fixes element-hq#19216 and element-hq#19216. * Fix leave space cancel button exploding ([\element-hq#6966](matrix-org/matrix-react-sdk#6966)). * Fix edge case behaviour of the space join spinner for guests ([\element-hq#6972](matrix-org/matrix-react-sdk#6972)). Fixes element-hq#19359 and element-hq#19359. * Convert emoticon to emoji at the end of a line on send even if the cursor isn't there ([\element-hq#6965](matrix-org/matrix-react-sdk#6965)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). * Fix text overflows button on Home page ([\#6898](matrix-org/matrix-react-sdk#6898)). Fixes element-hq#19180 and element-hq#19180. Contributed by [oliver-pham](https://github.com/oliver-pham). * Space Room View should react to join rule changes down /sync ([\#6945](matrix-org/matrix-react-sdk#6945)). Fixes element-hq#19390 and element-hq#19390. * Hide leave section button if user isn't in the room e.g peeking ([\element-hq#6920](matrix-org/matrix-react-sdk#6920)). Fixes element-hq#17410 and element-hq#17410. * Fix bug where room list would get stuck showing no rooms ([\element-hq#6939](matrix-org/matrix-react-sdk#6939)). Fixes element-hq#19373 and element-hq#19373. * Update room settings dialog title when room name changes ([\element-hq#6916](matrix-org/matrix-react-sdk#6916)). Fixes element-hq#17480 and element-hq#17480. Contributed by [psrpinto](https://github.com/psrpinto). * Fix editing losing emote-ness and rainbow-ness of messages ([\element-hq#6931](matrix-org/matrix-react-sdk#6931)). Fixes element-hq#19350 and element-hq#19350. * Remove semicolon from notifications panel ([\element-hq#6930](matrix-org/matrix-react-sdk#6930)). Contributed by [robintown](https://github.com/robintown). * Prevent profile image in left panel's backdrop from being selected ([\element-hq#6924](matrix-org/matrix-react-sdk#6924)). Contributed by [rom4nik](https://github.com/rom4nik). * Validate that the phone number verification field is filled before allowing user to submit ([\element-hq#6918](matrix-org/matrix-react-sdk#6918)). Fixes element-hq#19316 and element-hq#19316. Contributed by [VFermat](https://github.com/VFermat). * Updated how save button becomes disabled in room settings to listen for all fields instead of the most recent ([\element-hq#6917](matrix-org/matrix-react-sdk#6917)). Contributed by [LoganArnett](https://github.com/LoganArnett). * Use FocusLock around ContextMenus to simplify focus management ([\element-hq#6311](matrix-org/matrix-react-sdk#6311)). Fixes element-hq#19259 and element-hq#19259. * Fix space hierarchy pagination ([\element-hq#6908](matrix-org/matrix-react-sdk#6908)). Fixes element-hq#19276 and element-hq#19276. * Fix spaces keyboard shortcuts not working for last space ([\element-hq#6909](matrix-org/matrix-react-sdk#6909)). Fixes element-hq#19255 and element-hq#19255. * Use fallback avatar only for DMs with 2 people. ([\element-hq#6895](matrix-org/matrix-react-sdk#6895)). Fixes element-hq#18747 and element-hq#18747. Contributed by [andybalaam](https://github.com/andybalaam).
2 parents 4cbdff9 + e794234 commit d37fc69

20 files changed

+706
-495
lines changed

.github/ISSUE_TEMPLATE/bug-desktop.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ body:
2323
- type: textarea
2424
id: result
2525
attributes:
26-
label: What happened?
26+
label: Outcome
2727
placeholder: Tell us what went wrong
2828
value: |
29-
### What did you expect?
29+
#### What did you expect?
3030
31-
### What happened?
31+
#### What happened instead?
3232
validations:
3333
required: true
3434
- type: input
@@ -65,9 +65,9 @@ body:
6565
- type: dropdown
6666
id: rageshake
6767
attributes:
68-
label: Have you submitted a rageshake?
68+
label: Will you send logs?
6969
description: |
70-
Did you know that you can send a /rageshake command from your application to submit logs for this issue? Trigger the defect, then type /rageshake into the message entry area followed by a description of the problem and send the command. This will automatically submit anonymous logs to the developers.
70+
Did you know that you can send a /rageshake command from your application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
7171
options:
7272
- 'Yes'
7373
- 'No'

.github/ISSUE_TEMPLATE/bug-web.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ body:
2323
- type: textarea
2424
id: result
2525
attributes:
26-
label: What happened?
26+
label: Outcome
2727
placeholder: Tell us what went wrong
2828
value: |
29-
### What did you expect?
29+
#### What did you expect?
3030
31-
### What happened?
31+
#### What happened instead?
3232
validations:
3333
required: true
3434
- type: input
@@ -65,9 +65,9 @@ body:
6565
- type: dropdown
6666
id: rageshake
6767
attributes:
68-
label: Have you submitted a rageshake?
68+
label: Will you send logs?
6969
description: |
70-
Did you know that you can send a /rageshake command from the web applicaiton to submit logs for this issue? Trigger the defect, then type /rageshake into the message entry area followed by a description of the problem and send the command. This will automatically submit anonymous logs to the developers.
70+
Did you know that you can send a /rageshake command from the web application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
7171
options:
7272
- 'Yes'
7373
- 'No'

CHANGELOG.md

+130
Large diffs are not rendered by default.

docs/labs.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ Enables sending hidden read receipts as per [MSC2285](https://github.com/matrix-
134134

135135
Adds a "Message layout" section under `Settings -> Appearance`, where the user can select their preferred message layout (e.g. IRC or Modern). Additionally, adds a new "Message bubbles" layout.
136136

137-
## Pseudonymous Analytics opt-in
137+
## Pseudonymous Analytics opt-in (`feature_pseudonymous_analytics_opt_in`)
138138

139139
Opts in to collection of pseudonymous analytics data via Posthog. See https://github.com/matrix-org/matrix-react-sdk/pull/6495
140+
141+
## Polls (`feature_polls`) [In Development]
142+
143+
Polls are a way to gauge interest from your community about a certain topic with a simple voting mechanic
144+
within the message timeline. Note that this feature is currently under active development and therefore is
145+
entirely incomplete and may not work at all - it is not recommended for general use at this time.
146+
147+
Bug reports, feature requests, etc are not currently accepted for this feature flag. A later stage of
148+
development will provide opportunities for feedback.

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "element-web",
3-
"version": "1.9.2",
3+
"version": "1.9.3",
44
"description": "A feature-rich client for Matrix.org",
55
"author": "New Vector Ltd.",
66
"repository": {
@@ -58,11 +58,10 @@
5858
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz",
5959
"browser-request": "^0.3.3",
6060
"gfm.css": "^1.1.2",
61-
"highlight.js": "^10.5.0",
6261
"jsrsasign": "^10.2.0",
6362
"katex": "^0.12.0",
64-
"matrix-js-sdk": "14.0.1",
65-
"matrix-react-sdk": "3.32.1",
63+
"matrix-js-sdk": "15.0.0",
64+
"matrix-react-sdk": "3.33.0",
6665
"matrix-widget-api": "^0.1.0-beta.16",
6766
"prop-types": "^15.7.2",
6867
"react": "17.0.2",

src/@types/global.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616

1717
import "matrix-react-sdk/src/@types/global"; // load matrix-react-sdk's type extensions first
1818
import type { Renderer } from "react-dom";
19+
import type { logger } from "matrix-js-sdk/src/logger";
1920

2021
type ElectronChannel =
2122
"app_onAction" |
@@ -36,6 +37,7 @@ type ElectronChannel =
3637
declare global {
3738
interface Window {
3839
mxSendRageshake: (text: string, withLogs?: boolean) => void;
40+
matrixLogger: typeof logger;
3941
matrixChat: ReturnType<Renderer>;
4042

4143
// electron-only

src/i18n/strings/fi.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Dismiss": "Hylkää",
33
"Unknown device": "Tuntematon laite",
44
"Welcome to Element": "Tervetuloa Element-sovellukseen",
5-
"You need to be using HTTPS to place a screen-sharing call.": "Sinun täytyy käyttää HTTPS-yhteyttä, jotta voit jakaa ruudun puhelussa.",
5+
"You need to be using HTTPS to place a screen-sharing call.": "Sinun täytyy käyttää HTTPS-yhteyttä, jotta voit jakaa näytön puhelussa.",
66
"powered by Matrix": "moottorina Matrix",
77
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Hajautettua ja salattua viestintää Matrix-teknologialla",
88
"Sign In": "Kirjaudu",
@@ -32,5 +32,7 @@
3232
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Element-asetuksesi sisältävät epäkelpoa JSONia. Korjaa ongelma ja lataa sivu uudelleen.",
3333
"Powered by Matrix": "Moottorina Matrix",
3434
"Your browser can't run %(brand)s": "%(brand)s ei toimi selaimessasi",
35-
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s käyttää edistyneitä selaimen ominaisuuksia, joita nykyinen selaimesi ei tue."
35+
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s käyttää edistyneitä selaimen ominaisuuksia, joita nykyinen selaimesi ei tue.",
36+
"Use %(brand)s on mobile": "Käytä %(brand)sia mobiilisti",
37+
"Switch to space by number": "Vaihda avaruuteen käyttäen numeroa"
3638
}

src/i18n/strings/id.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Konfigurasi Element Anda mengandung JSON yang tidak valid. Mohon perbaiki masalahnya dan muat ulang halaman nya.",
99
"Invalid configuration: no default server specified.": "Konfigurasi tidak valid: server default belum ditentukan.",
1010
"Missing indexeddb worker script!": "Tidak ada script worker indexeddb!",
11-
"Explore rooms": "Jelajahi ruang",
11+
"Explore rooms": "Jelajahi ruangan",
1212
"Create Account": "Buat Akun",
1313
"Switch to space by number": "Beralih ke ruang dengan nomor",
1414
"Go to your browser to complete Sign In": "Buka browser Anda untuk menyelesaikan Masuk",
@@ -22,7 +22,7 @@
2222
"Your browser can't run %(brand)s": "Browser Anda tidak bisa menjalankan %(brand)s",
2323
"Unsupported browser": "Browser tidak didukung",
2424
"Use %(brand)s on mobile": "Gunakan %(brand)s di ponsel",
25-
"Powered by Matrix": "Didukung oleh Matrix",
25+
"Powered by Matrix": "Diberdayakan oleh Matrix",
2626
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
2727
"%(brand)s Desktop (%(platformName)s)": "%(brand)s Desktop (%(platformName)s)",
2828
"Previous/next recently visited room or community": "Ruangan atau komunitas yang baru saja dikunjungi sebelum/berikutnya",

src/i18n/strings/kab.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@
3232
"Open": "Ldi",
3333
"Your browser can't run %(brand)s": "Iminig-inek·inem ur isselkan ara %(brand)s",
3434
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s isseqdac timahilin n yiminig leqqayen ur yessefrak ara yiminig-ik·im amiran.",
35-
"Powered by Matrix": "Iteddu s lmendad n Matrix"
35+
"Powered by Matrix": "Iteddu s lmendad n Matrix",
36+
"Use %(brand)s on mobile": "Seqdec %(brand)s deg tiliɣri",
37+
"Switch to space by number": "Ddu ɣer space s uṭṭun"
3638
}

src/i18n/strings/ru.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"Create Account": "Создать учётную запись",
1010
"Explore rooms": "Список комнат",
1111
"Unexpected error preparing the app. See console for details.": "Неожиданная ошибка при подготовке приложения. Подробности см. в консоли.",
12-
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Неверная конфигурация: может указывать только один из следующих параметров: default_server_config, default_server_name или default_hs_url.",
12+
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Неверная конфигурация: можно указывать только один из следующих параметров: default_server_config, default_server_name или default_hs_url.",
1313
"Invalid configuration: no default server specified.": "Неверная конфигурация: сервер по умолчанию не указан.",
1414
"The message from the parser is: %(message)s": "Сообщение из парсера: %(message)s",
1515
"Invalid JSON": "Нерабочий JSON",

src/vector/app.tsx

+20-17
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery";
3131
import * as Lifecycle from "matrix-react-sdk/src/Lifecycle";
3232
import type MatrixChatType from "matrix-react-sdk/src/components/structures/MatrixChat";
3333
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
34+
import { logger } from "matrix-js-sdk/src/logger";
3435

3536
import { parseQs, parseQsFromFragment } from './url_utils';
3637
import VectorBasePlatform from "./platform/VectorBasePlatform";
3738
import { createClient } from "matrix-js-sdk/src/matrix";
3839

3940
let lastLocationHashSet: string = null;
4041

41-
console.log(`Application is running in ${process.env.NODE_ENV} mode`);
42+
logger.log(`Application is running in ${process.env.NODE_ENV} mode`);
43+
44+
window.matrixLogger = logger;
4245

4346
// Parse the given window.location and return parameters that can be used when calling
4447
// MatrixChat.showScreen(screen, params)
@@ -55,7 +58,7 @@ function getScreenFromLocation(location: Location) {
5558
function routeUrl(location: Location) {
5659
if (!window.matrixChat) return;
5760

58-
console.log("Routing URL ", location.href);
61+
logger.log("Routing URL ", location.href);
5962
const s = getScreenFromLocation(location);
6063
(window.matrixChat as MatrixChatType).showScreen(s.screen, s.params);
6164
}
@@ -71,7 +74,7 @@ function onHashChange(ev: HashChangeEvent) {
7174
// This will be called whenever the SDK changes screens,
7275
// so a web page can update the URL bar appropriately.
7376
function onNewScreen(screen: string, replaceLast = false) {
74-
console.log("newscreen " + screen);
77+
logger.log("newscreen " + screen);
7578
const hash = '#/' + screen;
7679
lastLocationHashSet = hash;
7780

@@ -133,7 +136,7 @@ function onTokenLoginCompleted() {
133136

134137
url.searchParams.delete("loginToken");
135138

136-
console.log(`Redirecting to ${url.href} to drop loginToken from queryparams`);
139+
logger.log(`Redirecting to ${url.href} to drop loginToken from queryparams`);
137140
window.history.replaceState(null, "", url.href);
138141
}
139142

@@ -145,7 +148,7 @@ export async function loadApp(fragParams: {}) {
145148
const params = parseQs(window.location);
146149

147150
const urlWithoutQuery = window.location.protocol + '//' + window.location.host + window.location.pathname;
148-
console.log("Vector starting at " + urlWithoutQuery);
151+
logger.log("Vector starting at " + urlWithoutQuery);
149152

150153
(platform as VectorBasePlatform).startUpdater();
151154

@@ -158,7 +161,7 @@ export async function loadApp(fragParams: {}) {
158161
const isReturningFromSso = !!params.loginToken;
159162
const autoRedirect = config['sso_immediate_redirect'] === true;
160163
if (!hasPossibleToken && !isReturningFromSso && autoRedirect) {
161-
console.log("Bypassing app load to redirect to SSO");
164+
logger.log("Bypassing app load to redirect to SSO");
162165
const tempCli = createClient({
163166
baseUrl: config['validated_server_config'].hsUrl,
164167
idBaseUrl: config['validated_server_config'].isUrl,
@@ -188,7 +191,7 @@ export async function loadApp(fragParams: {}) {
188191
async function verifyServerConfig() {
189192
let validatedConfig;
190193
try {
191-
console.log("Verifying homeserver configuration");
194+
logger.log("Verifying homeserver configuration");
192195

193196
// Note: the query string may include is_url and hs_url - we only respect these in the
194197
// context of email validation. Because we don't respect them otherwise, we do not need
@@ -219,8 +222,8 @@ async function verifyServerConfig() {
219222
}
220223

221224
if (hsUrl) {
222-
console.log("Config uses a default_hs_url - constructing a default_server_config using this information");
223-
console.warn(
225+
logger.log("Config uses a default_hs_url - constructing a default_server_config using this information");
226+
logger.warn(
224227
"DEPRECATED CONFIG OPTION: In the future, default_hs_url will not be accepted. Please use " +
225228
"default_server_config instead.",
226229
);
@@ -239,13 +242,13 @@ async function verifyServerConfig() {
239242

240243
let discoveryResult = null;
241244
if (wkConfig) {
242-
console.log("Config uses a default_server_config - validating object");
245+
logger.log("Config uses a default_server_config - validating object");
243246
discoveryResult = await AutoDiscovery.fromDiscoveryConfig(wkConfig);
244247
}
245248

246249
if (serverName) {
247-
console.log("Config uses a default_server_name - doing .well-known lookup");
248-
console.warn(
250+
logger.log("Config uses a default_server_name - doing .well-known lookup");
251+
logger.warn(
249252
"DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please " +
250253
"use default_server_config instead.",
251254
);
@@ -256,10 +259,10 @@ async function verifyServerConfig() {
256259
} catch (e) {
257260
const { hsUrl, isUrl, userId } = await Lifecycle.getStoredSessionVars();
258261
if (hsUrl && userId) {
259-
console.error(e);
260-
console.warn("A session was found - suppressing config error and using the session's homeserver");
262+
logger.error(e);
263+
logger.warn("A session was found - suppressing config error and using the session's homeserver");
261264

262-
console.log("Using pre-existing hsUrl and isUrl: ", { hsUrl, isUrl });
265+
logger.log("Using pre-existing hsUrl and isUrl: ", { hsUrl, isUrl });
263266
validatedConfig = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl, true);
264267
} else {
265268
// the user is not logged in, so scream
@@ -270,10 +273,10 @@ async function verifyServerConfig() {
270273
validatedConfig.isDefault = true;
271274

272275
// Just in case we ever have to debug this
273-
console.log("Using homeserver config:", validatedConfig);
276+
logger.log("Using homeserver config:", validatedConfig);
274277

275278
// Add the newly built config to the actual config for use by the app
276-
console.log("Updating SdkConfig with validated discovery information");
279+
logger.log("Updating SdkConfig with validated discovery information");
277280
SdkConfig.add({ "validated_server_config": validatedConfig });
278281

279282
return SdkConfig.get();

src/vector/index.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ limitations under the License.
2222
// Our own CSS (which is themed) is imported via separate webpack entry points
2323
// in webpack.config.js
2424
require('gfm.css/gfm.css');
25-
require('highlight.js/styles/github.css');
2625
require('katex/dist/katex.css');
2726

2827
/**
@@ -38,19 +37,21 @@ require('./localstorage-fix');
3837
import { parseQsFromFragment } from "./url_utils";
3938
import './modernizr';
4039

40+
import { logger } from "matrix-js-sdk/src/logger";
41+
4142
async function settled(...promises: Array<Promise<any>>) {
4243
for (const prom of promises) {
4344
try {
4445
await prom;
4546
} catch (e) {
46-
console.error(e);
47+
logger.error(e);
4748
}
4849
}
4950
}
5051

5152
function checkBrowserFeatures() {
5253
if (!window.Modernizr) {
53-
console.error("Cannot check features - Modernizr global is missing.");
54+
logger.error("Cannot check features - Modernizr global is missing.");
5455
return false;
5556
}
5657

@@ -77,14 +78,14 @@ function checkBrowserFeatures() {
7778
let featureComplete = true;
7879
for (let i = 0; i < featureList.length; i++) {
7980
if (window.Modernizr[featureList[i]] === undefined) {
80-
console.error(
81+
logger.error(
8182
"Looked for feature '%s' but Modernizr has no results for this. " +
8283
"Has it been configured correctly?", featureList[i],
8384
);
8485
return false;
8586
}
8687
if (window.Modernizr[featureList[i]] === false) {
87-
console.error("Browser missing feature: '%s'", featureList[i]);
88+
logger.error("Browser missing feature: '%s'", featureList[i]);
8889
// toggle flag rather than return early so we log all missing features rather than just the first.
8990
featureComplete = false;
9091
}
@@ -173,13 +174,13 @@ async function start() {
173174
// ##########################
174175
if (!acceptBrowser) {
175176
await new Promise<void>(resolve => {
176-
console.error("Browser is missing required features.");
177+
logger.error("Browser is missing required features.");
177178
// take to a different landing page to AWOOOOOGA at the user
178179
showIncompatibleBrowser(() => {
179180
if (window.localStorage) {
180181
window.localStorage.setItem('mx_accepts_unsupported_browser', String(true));
181182
}
182-
console.log("User accepts the compatibility risks.");
183+
logger.log("User accepts the compatibility risks.");
183184
resolve();
184185
});
185186
});
@@ -222,7 +223,7 @@ async function start() {
222223
// run on the components.
223224
await loadApp(fragparts.params);
224225
} catch (err) {
225-
console.error(err);
226+
logger.error(err);
226227
// Like the compatibility page, AWOOOOOGA at the user
227228
// This uses the default brand since the app config is unavailable.
228229
await showError(_t("Your Element is misconfigured"), [
@@ -232,7 +233,7 @@ async function start() {
232233
}
233234

234235
start().catch(err => {
235-
console.error(err);
236+
logger.error(err);
236237
// show the static error in an iframe to not lose any context / console data
237238
// with some basic styling to make the iframe full page
238239
delete document.body.style.height;

0 commit comments

Comments
 (0)