From fc828378fa1bbb26d1483e7ce3cea82318adcedc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 22 Apr 2020 13:18:54 +0100 Subject: [PATCH] Fix post-ts autocomplete, it is not null Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/autocomplete/AutocompleteProvider.tsx | 2 +- src/autocomplete/UserProvider.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/autocomplete/AutocompleteProvider.tsx b/src/autocomplete/AutocompleteProvider.tsx index 2cda2593a4..a40ce7144d 100644 --- a/src/autocomplete/AutocompleteProvider.tsx +++ b/src/autocomplete/AutocompleteProvider.tsx @@ -64,7 +64,7 @@ export default class AutocompleteProvider { commandRegex = this.forcedCommandRegex || /\S+/g; } - if (commandRegex === null) { + if (!commandRegex) { return null; } diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index 357c8750f7..1680eb5d54 100644 --- a/src/autocomplete/UserProvider.tsx +++ b/src/autocomplete/UserProvider.tsx @@ -102,7 +102,7 @@ export default class UserProvider extends AutocompleteProvider { const MemberAvatar = sdk.getComponent('views.avatars.MemberAvatar'); // lazy-load user list into matcher - if (this.users === null) this._makeUsers(); + if (!this.users) this._makeUsers(); let completions = []; const {command, range} = this.getCurrentCommand(rawQuery, selection, force); @@ -158,7 +158,7 @@ export default class UserProvider extends AutocompleteProvider { } onUserSpoke(user: RoomMember) { - if (this.users === null) return; + if (!this.users) return; if (!user) return; if (user.userId === MatrixClientPeg.get().credentials.userId) return;