Skip to content
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

Merged
merged 1 commit into from
Dec 15, 2020
Merged

Conversation

PVince81
Copy link
Member

@PVince81 PVince81 commented Dec 10, 2020

The code is in the very last commit if you want to have a peek.

@nickvergessen
Copy link
Member

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>
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, {
Copy link
Member Author

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍿

@PVince81 PVince81 marked this pull request as ready for review December 14, 2020 13:56
@nickvergessen nickvergessen merged commit 948aeed into master Dec 15, 2020
@nickvergessen nickvergessen deleted the enh/noid/cancel-search-while-typing branch December 15, 2020 12:30
@PVince81
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants