Skip to content

Commit 6ffa7e0

Browse files
authored
Sumby more validation (#6371)
1 parent 8f6bee4 commit 6ffa7e0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ui/packages/shared/profile/src/hooks/useQueryState.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
243243
// Sync computed sumBy to URL if URL doesn't already have a value
244244
// to ensure the shared URL can always pick it up.
245245
// Only run once (when sumByParam first becomes available), not on every change,
246-
// to avoid oscillation with external writers (useViewQueryState).
246+
// to avoid oscillation with external writers
247247
const hasSyncedSumByRef = useRef(false);
248248
useEffect(() => {
249249
if (sumByParam !== null) {
@@ -253,6 +253,7 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
253253
!hasSyncedSumByRef.current &&
254254
sumByParam === null &&
255255
computedSumByFromURL !== undefined &&
256+
computedSumByFromURL.length > 0 &&
256257
!sumBySelectionLoading
257258
) {
258259
hasSyncedSumByRef.current = true;

0 commit comments

Comments
 (0)