fix: defer updating state update to after update is complete

This commit is contained in:
Siyuan 2025-11-14 12:04:22 +00:00
parent 68bc480537
commit 4411c45cd5
1 changed files with 2 additions and 4 deletions

View File

@ -137,10 +137,6 @@ func (s *State) doUpdate(ctx context.Context, params UpdateParams) error {
if !params.CheckOnly {
s.updating = true
s.triggerStateUpdate()
defer func() {
s.updating = false
s.triggerStateUpdate()
}()
}
appUpdate, systemUpdate, err := s.getUpdateStatus(ctx, params)
@ -152,6 +148,8 @@ func (s *State) doUpdate(ctx context.Context, params UpdateParams) error {
s.triggerStateUpdate()
if params.CheckOnly {
s.updating = false
s.triggerStateUpdate()
return nil
}