Skip to content

Commit

Permalink
Remove background fetches
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdaley committed Mar 20, 2024
1 parent a2c4ccf commit 2e657f0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
6 changes: 1 addition & 5 deletions web/app/routes/authenticated/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ export default class DashboardRoute extends Route {
promises.push(this.latestDocs.fetchAll.perform().then(() => {}));
}

if (this.recentlyViewed.index) {
void this.recentlyViewed.fetchAll.perform();
} else {
promises.push(this.recentlyViewed.fetchAll.perform());
}
promises.push(this.recentlyViewed.fetchAll.perform());

const [docsAwaitingReview] = await Promise.all(promises);

Expand Down
6 changes: 0 additions & 6 deletions web/app/routes/authenticated/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,6 @@ export default class AuthenticatedDocumentRoute extends Route {
}

afterModel(model: DocumentRouteModel, transition: any) {
/**
* Generally speaking, ensure an up-to-date list of recently viewed docs
* by the time the user returns to the dashboard.
*/
void this.recentlyViewed.fetchAll.perform();

/**
* Record the document view with the analytics backend.
*/
Expand Down
5 changes: 0 additions & 5 deletions web/app/routes/authenticated/projects/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ export default class AuthenticatedProjectsProjectRoute extends Route {
}

afterModel() {
/**
* Update the recently viewed index in the background.
*/
void this.recentlyViewed.fetchAll.perform();

/**
* Set `newModelHasLoaded` false in case it was set true in the model hook.
*/
Expand Down

0 comments on commit 2e657f0

Please sign in to comment.