Skip to content

Commit 38ed6a2

Browse files
committed
Auto merge of #3045 - rust-lang:search-task-restartable, r=Turbo87
Keep only latest search API request We are currently using the `drop` modifier for the data task, which means that subsequent requests are ignored while the first request is in flight. Changing the modifier to `restartable` will take the data task drop all but the latest request. This should help with showing the correct search results when paginating and using the browser's back button. Partially addresses #3041.
2 parents 60ab5cc + cd298f2 commit 38ed6a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ export default class SearchController extends Controller {
5959
}
6060

6161
return yield this.store.query('crate', { all_keywords, page, per_page, q, sort });
62-
}).drop())
62+
}).restartable())
6363
dataTask;
6464
}

0 commit comments

Comments
 (0)