mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
fix(healthchat): refresh the account status whenever settings appears
The banner kept telling the user to complete a profile they had just completed, and nothing was fetched until the screen was actually shown.
This commit is contained in:
@@ -12,7 +12,8 @@ import SwiftUI
|
||||
// service is main-actor state — the hook's requirements are all @MainActor anyway.
|
||||
@MainActor
|
||||
final class HealthChatSettingsScreenHook: SettingsScreenHookProtocol {
|
||||
/// One load per session — the settings screen asks for this section on every body pass.
|
||||
// Owned here rather than by the section: the settings screen asks for the section on
|
||||
// every body pass. Nothing is fetched until the screen appears and asks for a refresh.
|
||||
private var statusLoader: HealthChatAccountStatusLoader?
|
||||
|
||||
// Constructed during hook registration, before the main actor is reachable.
|
||||
@@ -32,5 +33,9 @@ final class HealthChatSettingsScreenHook: SettingsScreenHookProtocol {
|
||||
return AnyView(HealthChatAccountStatusSection(loader: statusLoader,
|
||||
completeProfileAction: completeProfileAction))
|
||||
}
|
||||
|
||||
func refreshAccountStatus() {
|
||||
statusLoader?.load()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user