Skip to content

Commit 3dfdc5f

Browse files
committed
testing fixes for loading issues
1 parent c30508b commit 3dfdc5f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Web/src/components/features/user/ActiveSessions.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ const ActiveSessions: React.FC<ActiveSessionsProps> = ({
200200
} catch (err: unknown) {
201201
showToast('error', getErrorMessage(err) || t('activeSessions.errors.loadSessions'));
202202
} finally {
203-
if (showLoading) {
204-
setLoading(false);
205-
}
203+
// Always clear loading — showLoading only controls whether loading is
204+
// SET to true, not whether it's cleared. Prevents stuck loading state
205+
// when concurrent calls race with different showLoading values.
206+
setLoading(false);
206207
}
207208
},
208209
[currentPage, pageSize, setLoading, setSessions]

Web/src/hooks/useSteamWebApiStatus.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ export const useSteamWebApiStatus = () => {
4141
// Auth failed - silently set status to null and stop retrying
4242
hasFailedAuth.current = true;
4343
setStatus(null);
44-
if (!skipLoading) {
45-
setLoading(false);
46-
}
44+
setLoading(false);
4745
return;
4846
}
4947

@@ -58,9 +56,10 @@ export const useSteamWebApiStatus = () => {
5856
setError(errorMessage);
5957
console.error('[SteamWebApiStatus] Error:', err);
6058
} finally {
61-
if (!skipLoading) {
62-
setLoading(false);
63-
}
59+
// Always clear loading — skipLoading only controls whether loading is
60+
// SET to true, not whether it's cleared. Prevents stuck loading state
61+
// when concurrent calls race with different skipLoading values.
62+
setLoading(false);
6463
}
6564
}, []);
6665

0 commit comments

Comments
 (0)