We make source code browsing faster by re-using project-level data when navigating between files. This comes at a cost: Project info (like the issue counter), remotes and branches are only updated when the page is hard-refreshed or the user navigates away from the source code view.
We make source code browsing faster by re-using project-level data when navigating between files. This comes at a cost: Project info (like the issue counter), remotes and branches are only updated when the page is hard-refreshed or the user navigates away from the source code view.
I think we can accept the cost of not always having the latest data, since when user expect an update they are quick to hard-refresh. In favor of reducing the requests I would let user complain if they are bothered by this.
Just one minor nit, I would add the types to projectPromise and peersPromise
diff --git a/src/views/projects/router.ts b/src/views/projects/router.ts
index ea584b28..c3a4f570 100644
--- a/src/views/projects/router.ts
+++ b/src/views/projects/router.ts
@@ -420,8 +420,8 @@ async function loadTreeView(
route.project
}${commit ? `/${commit}` : ""}`;
- let projectPromise;
- let peersPromise;
+ let projectPromise: Promise<Project>;
+ let peersPromise: Promise<Remote[]>;
if (
previousLoaded.resource === "project.source" &&
previousLoaded.params.project.id === route.project &&
Thanks for addressing my comment, looks good to merge for me
Rebase.