Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade/element web v1.11.17 #362

Merged
merged 150 commits into from
Jan 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
189f4c5
Update babel monorepo (#23524)
renovate[bot] Oct 20, 2022
663754e
Update typescript-eslint monorepo to v5.40.1 (#23525)
renovate[bot] Oct 21, 2022
b924594
Update jest monorepo to v29.2.0 (#23544)
renovate[bot] Oct 21, 2022
a3ece52
Fix config.json failing to load for Jitsi wrapper in non-root deploym…
t3chguy Oct 24, 2022
fc0e61b
Update issue automation for design (#23490)
kittykat Oct 25, 2022
a45ecef
Add issue automation for the VoIP team (#23585)
kittykat Oct 25, 2022
b3ed90a
Merge branch 'master' into develop
RiotRobot Oct 25, 2022
b439940
Reset matrix-js-sdk back to develop branch
RiotRobot Oct 25, 2022
2f49467
Reset matrix-react-sdk back to develop branch
RiotRobot Oct 25, 2022
2b3467a
Add voice_broadcast.chunk_length config doc (#23410)
weeman1337 Oct 26, 2022
3366ed1
Run dockerhub builder stage without emulation (#23602)
t3chguy Oct 26, 2022
12bde9a
Update issue automation for labs features (#23609)
kittykat Oct 26, 2022
3f192f9
Merge branch 'master' into develop
RiotRobot Oct 26, 2022
fe0280c
Reset matrix-js-sdk back to develop branch
RiotRobot Oct 26, 2022
5da11ae
Reset matrix-react-sdk back to develop branch
RiotRobot Oct 26, 2022
2a46122
Change WYSIWYG label in automation (#23630)
langleyd Oct 27, 2022
1b98601
Constrain webpack config for `olm.wasm` (#23633)
richvdh Oct 28, 2022
a3659d8
Add issue automation to tidy Help Wanted (#23644)
kittykat Oct 31, 2022
8f46606
Upgrade matrix-js-sdk to 21.0.1
RiotRobot Nov 1, 2022
3402b38
Upgrade matrix-react-sdk to 3.59.1
RiotRobot Nov 1, 2022
e347f50
Prepare changelog for v1.11.13
RiotRobot Nov 1, 2022
6882e64
v1.11.13
RiotRobot Nov 1, 2022
8eafb70
Merge branch 'master' into develop
RiotRobot Nov 1, 2022
42b73de
Reset matrix-js-sdk back to develop branch
RiotRobot Nov 1, 2022
1176e51
Reset matrix-react-sdk back to develop branch
RiotRobot Nov 1, 2022
2422d96
Translations update from Weblate (#23672)
RiotTranslateBot Nov 1, 2022
da80530
Merge remote-tracking branch 'origin/develop' into develop
RiotRobot Nov 1, 2022
730c576
Upgrade matrix-js-sdk to 21.1.0-rc.1
RiotRobot Nov 1, 2022
b467ec1
Upgrade matrix-react-sdk to 3.60.0-rc.1
RiotRobot Nov 1, 2022
7353853
Prepare changelog for v1.11.14-rc.1
RiotRobot Nov 1, 2022
1cc0639
v1.11.14-rc.1
RiotRobot Nov 1, 2022
235d6bc
Update dependency @babel/runtime to v7.20.1 (#23675)
renovate[bot] Nov 1, 2022
5a73468
Update typescript-eslint monorepo to v5.42.0 (#23678)
renovate[bot] Nov 2, 2022
0e36757
Update jest monorepo to v29.2.1 (#23674)
renovate[bot] Nov 2, 2022
b92dd88
Add eslint rule unicorn/no-instanceof-array (#23667)
t3chguy Nov 2, 2022
9c302f3
Update PR automation (#23688)
kittykat Nov 3, 2022
1b51456
Update to @casualbot/jest-sonar-reporter (#23690)
t3chguy Nov 3, 2022
2e81324
Add A-Element-Call to labs automation (#23694)
robintown Nov 3, 2022
e21eb25
Optimise Jest run in CI (#23693)
t3chguy Nov 3, 2022
77d7598
Enable tsc --strict CI to prevent gaining more errors (#23692)
t3chguy Nov 4, 2022
577a6b7
Make SonarCloud happier (#23699)
t3chguy Nov 4, 2022
778c6d6
Update issue automation (#23686)
kittykat Nov 7, 2022
65b8bc1
Update dependency loader-utils to v2 [SECURITY] (#23717)
renovate[bot] Nov 7, 2022
fde6488
Upgrade matrix-react-sdk to 3.60.0-rc.2
RiotRobot Nov 8, 2022
3be527c
Deploy `develop` branch to Cloudflare Pages (#23454)
t3chguy Nov 8, 2022
3bcaf75
Prepare changelog for v1.11.14-rc.2
RiotRobot Nov 8, 2022
f77e5e7
v1.11.14-rc.2
RiotRobot Nov 8, 2022
d254926
Bump loader-utils from 2.0.2 to 2.0.3 (#23730)
dependabot[bot] Nov 8, 2022
9e62456
Upgrade matrix-js-sdk to 21.1.0
RiotRobot Nov 8, 2022
3fa3153
Upgrade matrix-react-sdk to 3.60.0
RiotRobot Nov 8, 2022
500c59f
Prepare changelog for v1.11.14
RiotRobot Nov 8, 2022
1d8e353
v1.11.14
RiotRobot Nov 8, 2022
1cf1973
Merge branch 'master' into develop
RiotRobot Nov 8, 2022
d5041b8
Reset matrix-js-sdk back to develop branch
RiotRobot Nov 8, 2022
14e4834
Reset matrix-react-sdk back to develop branch
RiotRobot Nov 8, 2022
8ed2329
Update matrix-events-sdk to 0.0.1 and develop ref to matrix-js-sdk (#…
t3chguy Nov 8, 2022
bc6d1c3
Add way to create a user notice via config.json (#23738)
t3chguy Nov 9, 2022
46c005a
Don't hardcode /bin/bash in scripts (#23740)
robintown Nov 9, 2022
8f8a9e1
Cease uploading develop.tar.gz to Github Pages (#23753)
t3chguy Nov 11, 2022
5a9baf7
Translations update from Weblate (#23775)
RiotTranslateBot Nov 15, 2022
fe78b16
Upgrade matrix-js-sdk to 21.2.0-rc.1
RiotRobot Nov 15, 2022
78bf0f6
Upgrade matrix-react-sdk to 3.61.0-rc.1
RiotRobot Nov 15, 2022
c929610
Prepare changelog for v1.11.15-rc.1
RiotRobot Nov 15, 2022
75df90d
v1.11.15-rc.1
RiotRobot Nov 15, 2022
a788d3f
Translations update from Weblate (#23779)
RiotTranslateBot Nov 16, 2022
d352c78
Update dependency loader-utils to v2.0.4 [SECURITY] (#23785)
renovate[bot] Nov 17, 2022
6bdc8da
Fix branch matching for the strict tsc CI (#23789)
t3chguy Nov 18, 2022
9231206
Add --noImplicitAny to strict CI check (#23793)
t3chguy Nov 18, 2022
ad466a2
Update jest monorepo to v29.2.3 (#23796)
renovate[bot] Nov 21, 2022
5ae6b49
Update typescript-eslint monorepo to v5.43.0 (#23798)
renovate[bot] Nov 21, 2022
4bf0dbb
Update babel monorepo (#23797)
renovate[bot] Nov 21, 2022
b34a4ed
Delete redeploy.py (#23814)
t3chguy Nov 22, 2022
c777be5
Upgrade matrix-js-sdk to 21.2.0
RiotRobot Nov 22, 2022
1ec2155
Upgrade matrix-react-sdk to 3.61.0
RiotRobot Nov 22, 2022
e9df942
Prepare changelog for v1.11.15
RiotRobot Nov 22, 2022
8c271f3
v1.11.15
RiotRobot Nov 22, 2022
6a07d25
Merge branch 'master' into develop
RiotRobot Nov 22, 2022
5cc0462
Reset matrix-js-sdk back to develop branch
RiotRobot Nov 22, 2022
c1d4abb
Reset matrix-react-sdk back to develop branch
RiotRobot Nov 22, 2022
cbf5c43
Update to eslint-plugin-matrix-org 0.8 (#23825)
weeman1337 Nov 23, 2022
c6a34ca
Attempt to unwedge develop (#23853)
t3chguy Nov 29, 2022
81966e4
Translations update from Weblate (#23866)
RiotTranslateBot Nov 29, 2022
957e93e
Upgrade matrix-js-sdk to 22.0.0-rc.1
RiotRobot Nov 29, 2022
bff0009
Upgrade matrix-react-sdk to 3.62.0-rc.1
RiotRobot Nov 29, 2022
293d119
Prepare changelog for v1.11.16-rc.1
RiotRobot Nov 29, 2022
6ba67ea
v1.11.16-rc.1
RiotRobot Nov 29, 2022
6c85cac
Update all (major) - abandoned (#23799)
renovate[bot] Nov 29, 2022
40a2934
Update alex-page/github-project-automation-plus digest to 1f8873e (#2…
renovate[bot] Nov 29, 2022
22341bc
Update typescript-eslint monorepo to v5.44.0 (#23872)
renovate[bot] Nov 29, 2022
7c4081e
Update CODEOWNERS (#23873)
t3chguy Nov 29, 2022
bdc112c
Update all non-major dependencies (#23871)
renovate[bot] Nov 30, 2022
c7c9d4f
Update @types/node (#23877)
t3chguy Nov 30, 2022
546c503
Lock file maintenance (#23394)
renovate[bot] Nov 30, 2022
76eb76f
Add `betas.md` (#22734)
SimonBrandner Nov 30, 2022
003fc7c
Remove prop-types (#23881)
t3chguy Dec 1, 2022
6d724cb
add docs for UIFeature.BulkUnverifiedSessionsReminder (#23875)
Dec 2, 2022
43335ed
Upgrade matrix-js-sdk to 22.0.0-rc.2
RiotRobot Dec 2, 2022
c0c84ed
Upgrade matrix-react-sdk to 3.62.0-rc.2
RiotRobot Dec 2, 2022
12bb305
Prepare changelog for v1.11.16-rc.2
RiotRobot Dec 2, 2022
4376a65
v1.11.16-rc.2
RiotRobot Dec 2, 2022
eb6d617
Downgrade to style-loader 2 to regain Webpack 4 compatibility (#23894)
robintown Dec 2, 2022
2cf4c5a
Update dependency @types/node to v16.18.4 (#23898)
renovate[bot] Dec 5, 2022
7defcf3
Adding tarfile member sanitization to extractall() (#23906)
t3chguy Dec 5, 2022
d4a0046
Upgrade matrix-js-sdk to 22.0.0
RiotRobot Dec 6, 2022
2bb0508
Upgrade matrix-react-sdk to 3.62.0
RiotRobot Dec 6, 2022
65dbfe4
Prepare changelog for v1.11.16
RiotRobot Dec 6, 2022
dd01341
v1.11.16
RiotRobot Dec 6, 2022
f278785
Merge branch 'master' into develop
RiotRobot Dec 6, 2022
549b0e8
Reset matrix-react-sdk back to develop branch
RiotRobot Dec 6, 2022
c473cb6
Reset matrix-js-sdk back to develop branch
RiotRobot Dec 6, 2022
d8131eb
Update project board IDs for automation (#23943)
kittykat Dec 8, 2022
a32f12c
Add prettier
weeman1337 Dec 9, 2022
7921a6c
Apply prettier formatting
weeman1337 Dec 9, 2022
6710a28
Add custom modernizr build to prettierignore
weeman1337 Dec 9, 2022
c6e0f0f
Update project board IDs for automation (#23950)
kittykat Dec 9, 2022
d4b9767
Fix GitHub workflow code style
weeman1337 Dec 9, 2022
fa2e306
Merge pull request #23821 from vector-im/weeman1337/prettier
andybalaam Dec 9, 2022
11572f9
Add andybalaam's issues to the team board
andybalaam Dec 12, 2022
e8fc433
Merge pull request #23964 from andybalaam/andybalaam/add-self-to-boar…
andybalaam Dec 12, 2022
60d05f0
Update docs links (#23966)
t3chguy Dec 12, 2022
c736076
Translations update from Weblate (#23979)
RiotTranslateBot Dec 13, 2022
96c0a37
Upgrade matrix-js-sdk to 23.0.0-rc.1
RiotRobot Dec 14, 2022
61253c3
Upgrade matrix-react-sdk to 3.63.0-rc.2
RiotRobot Dec 14, 2022
4e9ba16
Exclude CHANGELOG from prettier and undo what it did
RiotRobot Dec 14, 2022
26c101d
Prepare changelog for v1.11.17-rc.1
RiotRobot Dec 14, 2022
acbe597
v1.11.17-rc.1
RiotRobot Dec 14, 2022
ebd71f8
Upgrade matrix-js-sdk to 23.0.0
RiotRobot Dec 21, 2022
08095f5
Upgrade matrix-react-sdk to 3.63.0
RiotRobot Dec 21, 2022
25283a8
Prepare changelog for v1.11.17
RiotRobot Dec 21, 2022
193eb51
v1.11.17
RiotRobot Dec 21, 2022
1c4fada
upgrade/element-web-v1.11.17: fix conflits from element
aulamber Jan 9, 2023
f98ecb6
upgrade/element-web-v1.11.17: move workflows/backport to deactivated …
aulamber Jan 9, 2023
26fa959
Re-add postinstall command
aulamber Jan 9, 2023
5929fb5
Redo patches for : are-external-users-allowed-in-room, simplify-excha…
aulamber Jan 11, 2023
71e1a3d
Redo patch fix-key-request
aulamber Jan 11, 2023
143af74
redo patch change-keys-in-room-summary-card
odelcroi Jan 11, 2023
a98f8c5
redo patch user-friendlier-encrypted-messages
odelcroi Jan 11, 2023
5e38faa
redo patch hide-location-if-no-map-server
odelcroi Jan 11, 2023
0329720
Redo patches: hide-cross-signing-actions, hide-room-alias-settings, h…
aulamber Jan 11, 2023
c581f2d
Merge remote-tracking branch 'origin/upgrade/element-web-v1.11.17' in…
aulamber Jan 12, 2023
80526db
Redo patches: are-external-users-allowed-in-room, auto-accept-tac, hi…
aulamber Jan 12, 2023
389bebb
Redo patch redo-key-sharing-after-own-device-verification
aulamber Jan 12, 2023
ebe052d
Fix all remaining patches issues except forgot-password
aulamber Jan 16, 2023
20591f8
Merge branch 'develop_tchap' into upgrade/element-web-v1.11.17
aulamber Jan 16, 2023
254a7f2
revert workflows
odelcroi Jan 17, 2023
8a39686
remove forgot-password patch
odelcroi Jan 17, 2023
09897b9
Merge branch 'develop_tchap' into upgrade/element-web-v1.11.17
estellecomment Jan 19, 2023
8a94f9e
Remove snapshot test, we do not have control over html so it breaks t…
estellecomment Jan 19, 2023
3fe4d78
Reimplement forgot password for element-web 1.11.17 (#373)
estellecomment Jan 20, 2023
2e255ea
Upgrade/element-web v1.11.17 : fix linter (#383)
estellecomment Jan 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to eslint-plugin-matrix-org 0.8 (#23825)
* Update to eslint-plugin-matrix-org 0.8

* Exclude some eslint rules for specs

* Fix eslint tests path
  • Loading branch information
weeman1337 authored Nov 23, 2022
commit cbf5c43ae79d0896a1aa1b08b0e8608f65c9082a
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -72,5 +72,14 @@ module.exports = {
}],
}],
},
}, {
files: [
"test/**/*.{ts,tsx}",
],
rules: {
// We don't need super strict typing in test utilities
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
},
}],
};
6 changes: 3 additions & 3 deletions module_system/installer.ts
Original file line number Diff line number Diff line change
@@ -123,12 +123,12 @@ function readCurrentPackageDetails(): RawDependencies {
};
}

function writePackageDetails(deps: RawDependencies) {
function writePackageDetails(deps: RawDependencies): void {
fs.writeFileSync("./yarn.lock", deps.lockfile, "utf-8");
fs.writeFileSync("./package.json", deps.packageJson, "utf-8");
}

function callYarnAdd(dep: string) {
function callYarnAdd(dep: string): void {
// Add the module to the optional dependencies section just in case something
// goes wrong in restoring the original package details.
childProcess.execSync(`yarn add -O ${dep}`, {
@@ -186,6 +186,6 @@ function isModuleVersionCompatible(ourApiVersion: string, moduleApiVersion: stri
return semver.satisfies(ourApiVersion, moduleApiVersion);
}

function writeModulesTs(content: string) {
function writeModulesTs(content: string): void {
fs.writeFileSync("./src/modules.ts", content, "utf-8");
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@
"eslint-config-google": "^0.14.0",
"eslint-plugin-deprecate": "^0.7.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^0.7.0",
"eslint-plugin-matrix-org": "^0.8.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unicorn": "^44.0.2",
4 changes: 2 additions & 2 deletions src/components/views/auth/VectorAuthFooter.tsx
Original file line number Diff line number Diff line change
@@ -15,11 +15,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import React from 'react';
import React, { ReactElement } from 'react';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
import { _t } from 'matrix-react-sdk/src/languageHandler';

const VectorAuthFooter = () => {
const VectorAuthFooter = (): ReactElement => {
const brandingConfig = SdkConfig.getObject("branding");
const links = brandingConfig?.get("auth_footer_links") ?? [
{ "text": "Blog", "url": "https://element.io/blog" },
2 changes: 1 addition & 1 deletion src/components/views/auth/VectorAuthHeaderLogo.tsx
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ import * as React from 'react';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';

export default class VectorAuthHeaderLogo extends React.PureComponent {
public render() {
public render(): React.ReactElement {
const brandingConfig = SdkConfig.getObject("branding");
const logoUrl = brandingConfig?.get("auth_header_logo_url") ?? "themes/element/img/logos/element-logo.svg";

4 changes: 2 additions & 2 deletions src/components/views/auth/VectorAuthPage.tsx
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ export default class VectorAuthPage extends React.PureComponent {
private static welcomeBackgroundUrl;

// cache the url as a static to prevent it changing without refreshing
private static getWelcomeBackgroundUrl() {
private static getWelcomeBackgroundUrl(): string {
if (VectorAuthPage.welcomeBackgroundUrl) return VectorAuthPage.welcomeBackgroundUrl;

const brandingConfig = SdkConfig.getObject("branding");
@@ -42,7 +42,7 @@ export default class VectorAuthPage extends React.PureComponent {
return VectorAuthPage.welcomeBackgroundUrl;
}

public render() {
public render(): React.ReactElement {
const pageStyle = {
background: `center/cover fixed url(${VectorAuthPage.getWelcomeBackgroundUrl()})`,
};
6 changes: 3 additions & 3 deletions src/favicon.ts
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ export default class Favicon {
// callback to run once isReady is asserted, allows for a badge to be queued for when it can be shown
private readyCb?: () => void;

constructor(params: Partial<IParams> = {}) {
public constructor(params: Partial<IParams> = {}) {
this.params = { ...defaults, ...params };

this.icons = Favicon.getIcons();
@@ -68,7 +68,7 @@ export default class Favicon {
const lastIcon = this.icons[this.icons.length - 1];
if (lastIcon.hasAttribute("href")) {
this.baseImage.setAttribute("crossOrigin", "anonymous");
this.baseImage.onload = () => {
this.baseImage.onload = (): void => {
// get height and width of the favicon
this.canvas.height = (this.baseImage.height > 0) ? this.baseImage.height : 32;
this.canvas.width = (this.baseImage.width > 0) ? this.baseImage.width : 32;
@@ -217,7 +217,7 @@ export default class Favicon {

public badge(content: number | string, opts?: Partial<IParams>): void {
if (!this.isReady) {
this.readyCb = () => {
this.readyCb = (): void => {
this.badge(content, opts);
};
return;
8 changes: 4 additions & 4 deletions src/vector/app.tsx
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ limitations under the License.
// To ensure we load the browser-matrix version first
import "matrix-js-sdk/src/browser-index";

import React from 'react';
import React, { ReactElement } from 'react';
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
import { _td, newTranslatableError } from 'matrix-react-sdk/src/languageHandler';
import AutoDiscoveryUtils from 'matrix-react-sdk/src/utils/AutoDiscoveryUtils';
@@ -55,7 +55,7 @@ window.matrixLogger = logger;
// If we're in electron, we should never pass through a file:// URL otherwise
// the identity server will try to 302 the browser to it, which breaks horribly.
// so in that instance, hardcode to use app.element.io for now instead.
function makeRegistrationUrl(params: object) {
function makeRegistrationUrl(params: object): string {
let url;
if (window.location.protocol === "vector:") {
url = 'https://app.element.io/#/register';
@@ -81,7 +81,7 @@ function makeRegistrationUrl(params: object) {
return url;
}

function onTokenLoginCompleted() {
function onTokenLoginCompleted(): void {
// if we did a token login, we're now left with the token, hs and is
// url as query params in the url; a little nasty but let's redirect to
// clear them.
@@ -93,7 +93,7 @@ function onTokenLoginCompleted() {
window.history.replaceState(null, "", url.href);
}

export async function loadApp(fragParams: {}) {
export async function loadApp(fragParams: {}): Promise<ReactElement> {
initRouting();
const platform = PlatformPeg.get();

6 changes: 3 additions & 3 deletions src/vector/index.ts
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ require('katex/dist/katex.css');
require('./devcss');
require('./localstorage-fix');

async function settled(...promises: Array<Promise<any>>) {
async function settled(...promises: Array<Promise<any>>): Promise<void> {
for (const prom of promises) {
try {
await prom;
@@ -50,7 +50,7 @@ async function settled(...promises: Array<Promise<any>>) {
}
}

function checkBrowserFeatures() {
function checkBrowserFeatures(): boolean {
if (!window.Modernizr) {
logger.error("Cannot check features - Modernizr global is missing.");
return false;
@@ -102,7 +102,7 @@ const supportedBrowser = checkBrowserFeatures();
// We start loading stuff but don't block on it until as late as possible to allow
// the browser to use as much parallelism as it can.
// Load parallelism is based on research in https://github.com/vector-im/element-web/issues/12253
async function start() {
async function start(): Promise<void> {
// load init.ts async so that its code is not executed immediately and we can catch any exceptions
const {
rageshakePromise,
18 changes: 9 additions & 9 deletions src/vector/init.tsx
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ import { INSTALLED_MODULES } from "../modules";

export const rageshakePromise = initRageshake();

export function preparePlatform() {
export function preparePlatform(): void {
if (window.electron) {
logger.log("Using Electron platform");
PlatformPeg.set(new ElectronPlatform());
@@ -54,15 +54,15 @@ export function preparePlatform() {
}
}

export function setupLogStorage() {
export function setupLogStorage(): Promise<void> {
if (SdkConfig.get().bug_report_endpoint_url) {
return initRageshakeStore();
}
logger.warn("No bug report endpoint set - logs will not be persisted");
return Promise.resolve();
}

export async function loadConfig() {
export async function loadConfig(): Promise<void> {
// XXX: We call this twice, once here and once in MatrixChat as a prop. We call it here to ensure
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme.
//
@@ -112,7 +112,7 @@ export function loadOlm(): Promise<void> {
});
}

export async function loadLanguage() {
export async function loadLanguage(): Promise<void> {
const prefLang = SettingsStore.getValue("language", null, /*excludeDefault=*/true);
let langs = [];

@@ -131,11 +131,11 @@ export async function loadLanguage() {
}
}

export async function loadTheme() {
export async function loadTheme(): Promise<void> {
setTheme();
}

export async function loadApp(fragParams: {}) {
export async function loadApp(fragParams: {}): Promise<void> {
// load app.js async so that its code is not executed immediately and we can catch any exceptions
const module = await import(
/* webpackChunkName: "element-web-app" */
@@ -145,23 +145,23 @@ export async function loadApp(fragParams: {}) {
document.getElementById('matrixchat'));
}

export async function showError(title: string, messages?: string[]) {
export async function showError(title: string, messages?: string[]): Promise<void> {
const ErrorView = (await import(
/* webpackChunkName: "error-view" */
"../async-components/structures/ErrorView")).default;
window.matrixChat = ReactDOM.render(<ErrorView title={title} messages={messages} />,
document.getElementById('matrixchat'));
}

export async function showIncompatibleBrowser(onAccept) {
export async function showIncompatibleBrowser(onAccept): Promise<void> {
const CompatibilityView = (await import(
/* webpackChunkName: "compatibility-view" */
"../async-components/structures/CompatibilityView")).default;
window.matrixChat = ReactDOM.render(<CompatibilityView onAccept={onAccept} />,
document.getElementById('matrixchat'));
}

export async function loadModules() {
export async function loadModules(): Promise<void> {
for (const InstalledModule of INSTALLED_MODULES) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - we know the constructor exists even if TypeScript can't be convinced of that
34 changes: 17 additions & 17 deletions src/vector/jitsi/index.ts
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ let widgetApi: WidgetApi;
let meetApi: any; // JitsiMeetExternalAPI
let skipOurWelcomeScreen = false;

const setupCompleted = (async () => {
const setupCompleted = (async (): Promise<string | void> => {
try {
// Queue a config.json lookup asap, so we can use it later on. We want this to be concurrent with
// other setup work and therefore do not block.
@@ -223,11 +223,11 @@ const setupCompleted = (async () => {
}
})();

function enableJoinButton() {
document.getElementById("joinButton").onclick = () => joinConference();
function enableJoinButton(): void {
document.getElementById("joinButton").onclick = (): void => joinConference();
}

function switchVisibleContainers() {
function switchVisibleContainers(): void {
inConference = !inConference;

// Our welcome screen is managed by other code, so just don't switch to it ever
@@ -237,14 +237,14 @@ function switchVisibleContainers() {
}
}

function toggleConferenceVisibility(inConference: boolean) {
function toggleConferenceVisibility(inConference: boolean): void {
document.getElementById("jitsiContainer").style.visibility = inConference ? 'unset' : 'hidden';
// Video rooms have a separate UI for joining, so they should never show our join button
document.getElementById("joinButtonContainer").style.visibility =
(inConference || isVideoChannel) ? 'hidden' : 'unset';
}

function skipToJitsiSplashScreen() {
function skipToJitsiSplashScreen(): void {
// really just a function alias for self-documenting code
joinConference();
}
@@ -254,7 +254,7 @@ function skipToJitsiSplashScreen() {
*
* See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification
*/
function createJWTToken() {
function createJWTToken(): string {
// Header
const header = { alg: 'HS256', typ: 'JWT' };
// Payload
@@ -289,7 +289,7 @@ function createJWTToken() {
);
}

async function notifyHangup(errorMessage?: string) {
async function notifyHangup(errorMessage?: string): Promise<void> {
if (widgetApi) {
// We send the hangup event before setAlwaysOnScreen, because the latter
// can cause the receiving side to instantly stop listening.
@@ -301,7 +301,7 @@ async function notifyHangup(errorMessage?: string) {
}
}

function closeConference() {
function closeConference(): void {
switchVisibleContainers();
document.getElementById("jitsiContainer").innerHTML = "";

@@ -315,7 +315,7 @@ function closeConference() {
// audio input it can find, while an input of null instructs it to start muted,
// and a non-nullish input specifies the label of a specific device to use.
// Same for video inputs.
function joinConference(audioInput?: string | null, videoInput?: string | null) {
function joinConference(audioInput?: string | null, videoInput?: string | null): void {
let jwt;
if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) {
if (!openIdToken?.access_token) { // eslint-disable-line camelcase
@@ -408,7 +408,7 @@ function joinConference(audioInput?: string | null, videoInput?: string | null)
meetApi.on("log", onLog);
}

const onVideoConferenceJoined = () => {
const onVideoConferenceJoined = (): void => {
// Although we set our displayName with the userInfo option above, that
// option has a bug where it causes the name to be the HTML encoding of
// what was actually intended. So, we use the displayName command to at
@@ -432,12 +432,12 @@ const onVideoConferenceJoined = () => {
if (isVideoChannel) meetApi.executeCommand("setTileView", true);
};

const onVideoConferenceLeft = () => {
const onVideoConferenceLeft = (): void => {
notifyHangup();
meetApi = null;
};

const onErrorOccurred = ({ error }) => {
const onErrorOccurred = ({ error }): void => {
if (error.isFatal) {
// We got disconnected. Since Jitsi Meet might send us back to the
// prejoin screen, we're forced to act as if we hung up entirely.
@@ -447,12 +447,12 @@ const onErrorOccurred = ({ error }) => {
}
};

const onAudioMuteStatusChanged = ({ muted }) => {
const onAudioMuteStatusChanged = ({ muted }): void => {
const action = muted ? ElementWidgetActions.MuteAudio : ElementWidgetActions.UnmuteAudio;
widgetApi?.transport.send(action, {});
};

const onVideoMuteStatusChanged = ({ muted }) => {
const onVideoMuteStatusChanged = ({ muted }): void => {
if (muted) {
// Jitsi Meet always sends a "video muted" event directly before
// hanging up, which we need to ignore by padding the timeout here,
@@ -466,11 +466,11 @@ const onVideoMuteStatusChanged = ({ muted }) => {
}
};

const updateParticipants = () => {
const updateParticipants = (): void => {
widgetApi?.transport.send(ElementWidgetActions.CallParticipants, {
participants: meetApi.getParticipantsInfo(),
});
};

const onLog = ({ logLevel, args }) =>
const onLog = ({ logLevel, args }): void =>
(parent as unknown as typeof global).mx_rage_logger?.log(logLevel, ...args);
Loading