@@ -240,6 +240,15 @@ private extension SettingsViewModel {
240240 }
241241 }
242242 . store ( in: & cancellables)
243+
244+ credentialsManager. $accountSummary
245+ . receive ( on: DispatchQueue . main)
246+ . sink { [ weak self] _ in
247+ MainActor . assumeIsolated {
248+ self ? . reloadSections ( )
249+ }
250+ }
251+ . store ( in: & cancellables)
243252 }
244253
245254 /// Configures sections, to reload all the content - use reloadSections
@@ -291,22 +300,25 @@ private extension SettingsViewModel {
291300private extension SettingsViewModel {
292301 func accountSection( ) -> AppSettingsSection {
293302 let subtitle : AttributedString
294- if let accountSummary = credentialsManager. accountSummary,
295- let planText = accountSummary. planValidUntilAttributedString {
296- if accountSummary. isActive,
297- isAutoRenewEnabled ( accountSummary: accountSummary) ,
298- !accountSummary. isExpiringSoon,
299- !accountSummary. isExpiringWarning {
300- var second = AttributedString ( " * \( " autoRenews " . localizedString) " )
301- second. foregroundColor = NymColor . gray1
302- subtitle = planText + AttributedString( " \n " ) + second
303+ if let accountSummary = credentialsManager. accountSummary {
304+ if let planText = accountSummary. planValidUntilAttributedString {
305+ if accountSummary. isActive,
306+ isAutoRenewEnabled ( accountSummary: accountSummary) ,
307+ !accountSummary. isExpiringSoon,
308+ !accountSummary. isExpiringWarning {
309+ var second = AttributedString ( " * \( " autoRenews " . localizedString) " )
310+ second. foregroundColor = NymColor . gray1
311+ subtitle = planText + AttributedString( " \n " ) + second
312+ } else {
313+ subtitle = planText
314+ }
303315 } else {
304- subtitle = planText
316+ var first = AttributedString ( " noActivePlan " . localizedString)
317+ first. foregroundColor = NymColor . error
318+ subtitle = first
305319 }
306320 } else {
307- var first = AttributedString ( " noActivePlan " . localizedString)
308- first. foregroundColor = NymColor . error
309- subtitle = first
321+ subtitle = AttributedString ( " requestingZkNyms " . localizedString)
310322 }
311323
312324 var viewModels = [
0 commit comments