Skip to content

Commit

Permalink
fix code location status when a new location is added in a loading st…
Browse files Browse the repository at this point in the history
…ate (#11654)

### Summary & Motivation
Hitting a bug where a newly added code location in a loading state
requires a page refresh to load the placeholder table.

### How I Tested These Changes
Removed all code locations locally, created a new one in a new tab, saw
the locations table immediately
  • Loading branch information
prha committed Jan 12, 2023
1 parent 53399a5 commit 9adccb5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ export const useCodeLocationsStatus = (skip = false): StatusAndMessage | null =>
const anyCurrentlyLoading = currentlyLoading.length > 0;

// If this is a fresh pageload and any locations are loading, show the spinner but not the toaster.
if (!previousEntriesById) {
if (!previousEntries.length) {
if (anyCurrentlyLoading) {
setShowSpinner(true);
}
reloadWorkspaceQuietly();
return;
}

Expand Down

0 comments on commit 9adccb5

Please sign in to comment.