From 10fb9dfa29faa618fc3753e8e5beb76cc694abec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 16:55:16 +0000 Subject: [PATCH] refactor: simplify GetLastStatus nil check and failsafe condition per review Agent-Logs-Url: https://github.com/xAlokyx/3x-ui/sessions/dd7a9d3c-fddb-4521-9fcf-26bb342d408c Co-authored-by: xAlokyx <234771438+xAlokyx@users.noreply.github.com> --- web/controller/server.go | 3 --- web/html/index.html | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/web/controller/server.go b/web/controller/server.go index a3d46f1a..ea96ac94 100644 --- a/web/controller/server.go +++ b/web/controller/server.go @@ -114,9 +114,6 @@ func (a *ServerController) status(c *gin.Context) { func (a *ServerController) GetLastStatus() any { a.mu.RLock() defer a.mu.RUnlock() - if a.lastStatus == nil { - return nil - } return a.lastStatus } diff --git a/web/html/index.html b/web/html/index.html index 757da595..9bdf5b89 100644 --- a/web/html/index.html +++ b/web/html/index.html @@ -1139,9 +1139,7 @@ // timeout of 6 seconds guarantees the loading screen always clears. await (async () => { const failsafeTimer = setTimeout(() => { - if (!this.loadingStates.fetched) { - this.loadingStates.fetched = true; - } + this.loadingStates.fetched = true; }, 6000); const maxRetries = 5; for (let i = 0; i < maxRetries; i++) {