Merge pull request #6345 from matrix-org/t3chguy/ts/c1

This commit is contained in:
Michael Telatynski 2021-07-14 17:19:07 +01:00 committed by GitHub
commit 57f9b819b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 205 additions and 276 deletions

View file

@ -26,7 +26,7 @@ Once a timer is finished or aborted, it can't be started again
a new one through `clone()` or `cloneIfRun()`.
*/
export default class Timer {
private timerHandle: NodeJS.Timeout;
private timerHandle: number;
private startTs: number;
private promise: Promise<void>;
private resolve: () => void;

View file

@ -386,7 +386,7 @@ export default class WidgetUtils {
});
}
static removeIntegrationManagerWidgets(): Promise<void> {
static async removeIntegrationManagerWidgets(): Promise<void> {
const client = MatrixClientPeg.get();
if (!client) {
throw new Error('User not logged in');
@ -399,7 +399,7 @@ export default class WidgetUtils {
delete userWidgets[key];
}
});
return client.setAccountData('m.widgets', userWidgets);
await client.setAccountData('m.widgets', userWidgets);
}
static addIntegrationManagerWidget(name: string, uiUrl: string, apiUrl: string): Promise<void> {
@ -416,7 +416,7 @@ export default class WidgetUtils {
* Remove all stickerpicker widgets (stickerpickers are user widgets by nature)
* @return {Promise} Resolves on account data updated
*/
static removeStickerpickerWidgets(): Promise<void> {
static async removeStickerpickerWidgets(): Promise<void> {
const client = MatrixClientPeg.get();
if (!client) {
throw new Error('User not logged in');
@ -429,7 +429,7 @@ export default class WidgetUtils {
delete userWidgets[key];
}
});
return client.setAccountData('m.widgets', userWidgets);
await client.setAccountData('m.widgets', userWidgets);
}
static makeAppConfig(