From 093b7bbf720f4eb60288fd97a3012716f939557e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 5 Apr 2020 00:27:59 +0100 Subject: [PATCH] convert index.js to typescript Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/{index.js => index.ts} | 2 +- src/vector/rageshakesetup.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) rename src/vector/{index.js => index.ts} (98%) 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 9ad72870e1..74db1cd687 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 cef9d53823..e495557429 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) {