diff --git a/src/vector/index.js b/src/vector/index.ts similarity index 98% rename from src/vector/index.js rename to src/vector/index.ts index 9ad72870..74db1cd6 100644 --- a/src/vector/index.js +++ b/src/vector/index.ts @@ -32,7 +32,7 @@ if ('serviceWorker' in navigator) { navigator.serviceWorker.register('sw.js'); } -async function settled(prom) { +async function settled(prom: Promise) { try { await prom; } catch (e) { diff --git a/src/vector/rageshakesetup.ts b/src/vector/rageshakesetup.ts index cef9d538..e4955574 100644 --- a/src/vector/rageshakesetup.ts +++ b/src/vector/rageshakesetup.ts @@ -31,7 +31,8 @@ import SdkConfig from "matrix-react-sdk/src/SdkConfig"; import sendBugReport from "matrix-react-sdk/src/rageshake/submit-rageshake"; export function initRageshake() { - rageshake.init().then(() => { + const prom = rageshake.init(); + prom.then(() => { console.log("Initialised rageshake."); console.log("To fix line numbers in Chrome: " + "Meatball menu → Settings → Blackboxing → Add /rageshake\\.js$"); @@ -46,6 +47,7 @@ export function initRageshake() { }, (err) => { console.error("Failed to initialise rageshake: " + err); }); + return prom; } window.mxSendRageshake = function(text: string, withLogs?: boolean) {