-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel search while typing #4742
Conversation
Sounds like a good idea |
The search requests in the left sidebar, new conversation dialog and participants tab are now cancellable. They cancel either when the user continues to type or when exiting or destroying the component. This should help reduce the load on servers while people are searching. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
df2819e
to
235f5d9
Compare
const searchListedConversations = async function(searchTerm) { | ||
const response = await axios.get(generateOcsUrl('apps/spreed/api/v3', 2) + 'listed-room', { | ||
const searchListedConversations = async function(searchTerm, options) { | ||
return axios.get(generateOcsUrl('apps/spreed/api/v3', 2) + 'listed-room', Object.assign(options, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: await is gone because redundant (if you leave it here eslint will warn about it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍿
I was so focused on testing the cancellability that I forgot to test if the search actually works. A copy-paste issue had sneaked in, fixed here: #4835 |
The code is in the very last commit if you want to have a peek.