From a6178ca1f3d4b2ccb1117fc3c84260465cec14e1 Mon Sep 17 00:00:00 2001 From: joshavant <830519+joshavant@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:05:57 -0500 Subject: [PATCH] UI: combine usage controller early-return guards --- ui/src/ui/controllers/usage.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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;