Skip to content

Commit 1c72a3a

Browse files
committed
Sync plugins when settings is opened
This ensures that we have the latest plugin data to show whether the WooCommerce plugin has available updates. If we don’t sync it when settings is opened, we may be relying on very old stored data, depending on the user’s usage pattern for the app. Previously, the plugins were only synced on login/fresh launch, or for a few IPP-related actions.
1 parent 635e362 commit 1c72a3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Settings/SettingsViewModel.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ final class SettingsViewModel: SettingsViewModelOutput, SettingsViewModelActions
134134
} else {
135135
paymentGatewayAccountsResultsController = nil
136136
}
137+
138+
/// Synchronize system plugins for the WooCommerce plugin version row
139+
///
140+
if let siteID = stores.sessionManager.defaultSite?.siteID {
141+
let action = SystemStatusAction.synchronizeSystemPlugins(siteID: siteID, onCompletion: { _ in })
142+
stores.dispatch(action)
143+
}
137144
}
138145

139146
/// Sets up the view model and loads the settings.

0 commit comments

Comments
 (0)