Skip to content

Commit 9aaff0f

Browse files
committed
index: Reuse GET /summary result
This will cause the app to only once perform the `GET /summary` call and then keep showing the same data until the whole app is refreshed. This should get rid of the annoying loading screen when navigating from the frontpage to a crate and then back again.
1 parent fa861fe commit 9aaff0f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/routes/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ export default Route.extend({
1919
setupController(controller) {
2020
this.controllerFor('application').set('searchQuery', null);
2121

22-
let promise = controller.dataTask.perform();
23-
if (this.fastboot.isFastBoot) {
24-
this.fastboot.deferRendering(promise);
22+
if (!controller.dataTask.hasData) {
23+
let promise = controller.dataTask.perform();
24+
if (this.fastboot.isFastBoot) {
25+
this.fastboot.deferRendering(promise);
26+
}
2527
}
2628
},
2729
});

0 commit comments

Comments
 (0)