diff --git a/ui/src/ui/controllers/usage.ts b/ui/src/ui/controllers/usage.ts index 20a972d1df7..9b1f5d5373b 100644 --- a/ui/src/ui/controllers/usage.ts +++ b/ui/src/ui/controllers/usage.ts @@ -270,10 +270,7 @@ export const __test = { }; export async function loadSessionTimeSeries(state: UsageState, sessionKey: string) { - if (!state.client || !state.connected) { - return; - } - if (state.usageTimeSeriesLoading) { + if (!state.client || !state.connected || state.usageTimeSeriesLoading) { return; } state.usageTimeSeriesLoading = true; @@ -292,10 +289,7 @@ export async function loadSessionTimeSeries(state: UsageState, sessionKey: strin } export async function loadSessionLogs(state: UsageState, sessionKey: string) { - if (!state.client || !state.connected) { - return; - } - if (state.usageSessionLogsLoading) { + if (!state.client || !state.connected || state.usageSessionLogsLoading) { return; } state.usageSessionLogsLoading = true;