From e9336eab63daa5ad04cac28b50a3ff52bb7ab5cb Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 15 May 2018 14:18:02 +0100 Subject: [PATCH] lint --- src/ScalarMessaging.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 796252fc1b..5940565517 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -290,6 +290,9 @@ function inviteUser(event, roomId, userId) { * Returns a promise that resolves when a widget with the given * ID has been added as a user widget (ie. the accountData event * arrives) or rejects after a timeout + * + * @param {string} widgetId The ID of the widget to wait for + * @returns {Promise} that resolves when the widget is available */ function waitForUserWidget(widgetId) { return new Promise((resolve, reject) => { @@ -303,7 +306,6 @@ function waitForUserWidget(widgetId) { return; } - let timerId; function onAccountData(ev) { if (ev.getType() != 'm.widgets') return; @@ -313,7 +315,7 @@ function waitForUserWidget(widgetId) { resolve(); } } - timerId = setTimeout(() => { + const timerId = setTimeout(() => { MatrixClientPeg.get().removeListener('accountData', onAccountData); reject(new Error("Timed out waiting for widget ID " + widgetId + " to appear")); }, 10000);