mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
fix(ume): declare serverSubLost before wsPillLevel uses it
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
fb374a9c36
commit
aaee32a7a8
1 changed files with 9 additions and 9 deletions
|
|
@ -239,6 +239,15 @@ export function UmePage({ toastOk, toastError }: UmePageProps) {
|
|||
const wsLabel =
|
||||
wsConn?.label ||
|
||||
(wsPaused ? "已暂停" : wsConsumer?.last_error || wsConsumer?.status || "-");
|
||||
const subscriptionActive = Boolean(alarmSub.active);
|
||||
const serverSubLost = Boolean(
|
||||
subscriptionStatusQuery.data?.server_subscription_lost ?? alarmSub.server_subscription_lost,
|
||||
);
|
||||
const serverSubLostReason = String(
|
||||
subscriptionStatusQuery.data?.server_subscription_lost_reason ??
|
||||
alarmSub.server_subscription_lost_reason ??
|
||||
"",
|
||||
);
|
||||
const wsPillLevel =
|
||||
serverSubLost || wsState === "subscription_lost"
|
||||
? "warn"
|
||||
|
|
@ -254,15 +263,6 @@ export function UmePage({ toastOk, toastError }: UmePageProps) {
|
|||
? "up"
|
||||
: "unknown";
|
||||
const wsLogs = [...(subscriptionStatusQuery.data?.ws_logs ?? alarmSub.ws_logs ?? [])].reverse();
|
||||
const subscriptionActive = Boolean(alarmSub.active);
|
||||
const serverSubLost = Boolean(
|
||||
subscriptionStatusQuery.data?.server_subscription_lost ?? alarmSub.server_subscription_lost,
|
||||
);
|
||||
const serverSubLostReason = String(
|
||||
subscriptionStatusQuery.data?.server_subscription_lost_reason ??
|
||||
alarmSub.server_subscription_lost_reason ??
|
||||
"",
|
||||
);
|
||||
const subPending =
|
||||
subscriptionEstablishMutation.isPending ||
|
||||
subscriptionCancelMutation.isPending ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue