From ee3339bf189401b14896dcafc7c3e2369eddc590 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 4 Jan 2016 12:04:57 +0000 Subject: [PATCH] Fix unresponsive search closes #6274 - any time the search content is refreshed, start with a clean array instead of performing expensive object comparisons to remove existing content --- core/client/app/components/gh-search-input.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/client/app/components/gh-search-input.js b/core/client/app/components/gh-search-input.js index e359cf2ba9..ab85e4d8d9 100644 --- a/core/client/app/components/gh-search-input.js +++ b/core/client/app/components/gh-search-input.js @@ -37,6 +37,7 @@ export default Component.extend({ } this.set('isLoading', true); + this.set('content', []); promises.pushObject(this._loadPosts()); promises.pushObject(this._loadUsers()); promises.pushObject(this._loadTags()); @@ -54,8 +55,6 @@ export default Component.extend({ let content = this.get('content'); return ajax(postsUrl, {data: postsQuery}).then((posts) => { - content.removeObjects(this.get('posts')); - content.removeObjects(this.get('pages')); content.pushObjects(posts.posts.map((post) => { return { id: `post.${post.id}`, @@ -73,7 +72,6 @@ export default Component.extend({ let content = this.get('content'); return ajax(usersUrl, {data: usersQuery}).then((users) => { - content.removeObjects(this.get('users')); content.pushObjects(users.users.map((user) => { return { id: `user.${user.slug}`, @@ -91,7 +89,6 @@ export default Component.extend({ let content = this.get('content'); return ajax(tagsUrl, {data: tagsQuery}).then((tags) => { - content.removeObjects(this.get('tags')); content.pushObjects(tags.tags.map((tag) => { return { id: `tag.${tag.slug}`,