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>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-08 16:55:16 +00:00 committed by GitHub
parent 159457d57b
commit 10fb9dfa29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 6 deletions

View file

@ -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
}

View file

@ -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++) {