diff --git a/app/views/DirectoryView/index.tsx b/app/views/DirectoryView/index.tsx index e827e732c5..d4611f9d01 100644 --- a/app/views/DirectoryView/index.tsx +++ b/app/views/DirectoryView/index.tsx @@ -150,7 +150,8 @@ class DirectoryView extends React.Component { - this.setState({ type, data: [] }, () => this.search()); + this.load.stop(); + this.setState({ type, data: [], total: -1 }, () => this.search()); if (type === 'users') { logEvent(events.DIRECTORY_SEARCH_USERS); @@ -163,8 +164,9 @@ class DirectoryView extends React.Component { + this.load.stop(); this.setState( - ({ globalUsers }) => ({ globalUsers: !globalUsers, data: [] }), + ({ globalUsers }) => ({ globalUsers: !globalUsers, data: [], total: -1 }), () => this.search() ); };