From 41e4b9b420e47a64856e2a09dae65460ca343d71 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 13 Jun 2024 11:24:14 +0100 Subject: [PATCH 1/2] Avoid usage of setImmediate, prefer setTimeout Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/favicon.ts | 4 ++-- src/vector/index.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/favicon.ts b/src/favicon.ts index 5b8109501fd..5141bf1f373 100644 --- a/src/favicon.ts +++ b/src/favicon.ts @@ -194,9 +194,9 @@ export default class Favicon { } private setIcon(canvas: HTMLCanvasElement): void { - setImmediate(() => { + setTimeout(() => { this.setIconSrc(canvas.toDataURL("image/png")); - }); + }, 0); } private setIconSrc(url: string): void { diff --git a/src/vector/index.ts b/src/vector/index.ts index e21fa5860a1..bb9ae9ed0f3 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -25,9 +25,6 @@ import { extractErrorMessageFromError } from "matrix-react-sdk/src/components/vi import { parseQsFromFragment } from "./url_utils"; import "./modernizr"; -// Make setImmediate available in bundle -import "setimmediate"; - // Require common CSS here; this will make webpack process it into bundle.css. // Our own CSS (which is themed) is imported via separate webpack entry points // in webpack.config.js From 01ee8737853e598c9b9777c270b3d408dd27962b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 13 Jun 2024 11:24:20 +0100 Subject: [PATCH 2/2] Remove setimmediate dep Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 965dcc24749..f5c24ba8edd 100644 --- a/package.json +++ b/package.json @@ -191,7 +191,6 @@ "raw-loader": "^4.0.2", "rimraf": "^5.0.0", "semver": "^7.5.2", - "setimmediate": "^1.0.5", "string-replace-loader": "3", "style-loader": "4", "stylelint": "^16.1.0",