From eeff919c598d0c0422724da2325325c9b9674eb5 Mon Sep 17 00:00:00 2001 From: John Obelenus Date: Wed, 24 Jul 2024 16:47:02 -0400 Subject: [PATCH] Fix: do not call status_with_base when... you are on base --- app/web/src/router.ts | 7 ++++++- app/web/src/store/change_sets.store.ts | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/web/src/router.ts b/app/web/src/router.ts index 87a65c09a2..b2c570f573 100644 --- a/app/web/src/router.ts +++ b/app/web/src/router.ts @@ -192,7 +192,12 @@ router.beforeResolve((to) => { if ("changeSetId" in to.params) { const changeSetStore = useChangeSetsStore(); const changeSetId = to.params.changeSetId; - if (changeSetId && changeSetId !== "auto" && !Array.isArray(changeSetId)) + if ( + changeSetId && + changeSetId !== "head" && + changeSetId !== "auto" && + !Array.isArray(changeSetId) + ) changeSetStore.FETCH_STATUS_WITH_BASE(changeSetId); } }); diff --git a/app/web/src/store/change_sets.store.ts b/app/web/src/store/change_sets.store.ts index 8b0659a882..9b241b435e 100644 --- a/app/web/src/store/change_sets.store.ts +++ b/app/web/src/store/change_sets.store.ts @@ -155,6 +155,8 @@ export function useChangeSetsStore() { }); }, async FETCH_STATUS_WITH_BASE(changeSetId: ChangeSetId) { + // do not call this with `head` + if (changeSetId === "head") return Promise.resolve(); return new ApiRequest({ method: "post", url: "change_set/status_with_base", @@ -381,7 +383,7 @@ export function useChangeSetsStore() { } // TODO: jobelenus, I'm worried the WsEvent fires before commit happens - if (this.selectedChangeSetId) + if (this.selectedChangeSetId && !this.headSelected) this.FETCH_STATUS_WITH_BASE(this.selectedChangeSetId); // did head get an update and I'm not on head?