Skip to content

Commit bc45419

Browse files
committed
Revert "Merge #1194"
This reverts commit 37682dc, reversing changes made to ae43922.
1 parent b4d49ac commit bc45419

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

app/controllers/application.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ export default Controller.extend(EKMixin, {
2121
}),
2222

2323
actions: {
24-
search(q) {
25-
if (q !== undefined) {
26-
this.set('searchQuery', q);
27-
}
28-
24+
search() {
2925
this.transitionToRoute('search', {
3026
queryParams: {
3127
q: this.get('searchQuery'),

app/controllers/search.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import { computed } from '@ember/object';
33
import { alias, bool, readOnly } from '@ember/object/computed';
44
import { inject as service } from '@ember/service';
55

6-
import { task, timeout } from 'ember-concurrency';
6+
import { task } from 'ember-concurrency';
77

88
import PaginationMixin from '../mixins/pagination';
99

10-
const DEBOUNCE_MS = 250;
11-
1210
export default Controller.extend(PaginationMixin, {
1311
search: service(),
1412
queryParams: ['q', 'page', 'per_page', 'sort'],
@@ -42,13 +40,10 @@ export default Controller.extend(PaginationMixin, {
4240
hasItems: bool('totalItems'),
4341

4442
dataTask: task(function* (params) {
45-
// debounce the search query
46-
yield timeout(DEBOUNCE_MS);
47-
4843
if (params.q !== null) {
4944
params.q = params.q.trim();
5045
}
5146

5247
return yield this.store.query('crate', params);
53-
}).restartable(),
48+
}).drop(),
5449
});

app/templates/application.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<input type="text" class="search" name="q" id="cargo-desktop-search"
2222
placeholder="Click or press 'S' to search..."
2323
value={{searchQuery}}
24-
oninput={{action "search" value="target.value"}}
24+
oninput={{action (mut searchQuery) value="target.value"}}
2525
autofocus="autofocus"
2626
tabindex="1"
2727
required
@@ -106,7 +106,7 @@
106106
<input type="text" class="search" name="q"
107107
placeholder="Search"
108108
value={{searchQuery}}
109-
oninput={{action "search" value="target.value"}}
109+
oninput={{action (mut searchQuery) value="target.value"}}
110110
autocorrect="off"
111111
tabindex="1"
112112
required>

0 commit comments

Comments
 (0)