Skip to content

Commit

Permalink
Merge pull request #4230 from systeminit/fix/dont-compare-to-base-whe…
Browse files Browse the repository at this point in the history
…n-on-head

Fix: do not call status_with_base when... you are on base
  • Loading branch information
jobelenus authored Jul 24, 2024
2 parents aaff729 + eeff919 commit 101e6dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/web/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down
4 changes: 3 additions & 1 deletion app/web/src/store/change_sets.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<StatusWithBase>({
method: "post",
url: "change_set/status_with_base",
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 101e6dc

Please sign in to comment.