Composer: Fix account switcher in share sheet

This commit is contained in:
Thomas Ricouard 2023-02-17 13:30:45 +01:00
parent 59d8346bc8
commit b7e7ee0736
2 changed files with 4 additions and 2 deletions

View file

@ -103,5 +103,6 @@ extension View {
.environmentObject(Theme.shared) .environmentObject(Theme.shared)
.environmentObject(AppAccountsManager.shared) .environmentObject(AppAccountsManager.shared)
.environmentObject(PushNotificationsService.shared) .environmentObject(PushNotificationsService.shared)
.environmentObject(AppAccountsManager.shared.currentClient)
} }
} }

View file

@ -12,7 +12,7 @@ import UIKit
import StoreKit import StoreKit
public struct StatusEditorView: View { public struct StatusEditorView: View {
@EnvironmentObject private var appAccounnt: AppAccountsManager @EnvironmentObject private var appAccounts: AppAccountsManager
@EnvironmentObject private var preferences: UserPreferences @EnvironmentObject private var preferences: UserPreferences
@EnvironmentObject private var theme: Theme @EnvironmentObject private var theme: Theme
@EnvironmentObject private var client: Client @EnvironmentObject private var client: Client
@ -161,9 +161,10 @@ public struct StatusEditorView: View {
} }
} }
.interactiveDismissDisabled(!viewModel.shouldDisplayDismissWarning) .interactiveDismissDisabled(!viewModel.shouldDisplayDismissWarning)
.onChange(of: appAccounnt.currentClient) { newClient in .onChange(of: appAccounts.currentClient) { newClient in
if viewModel.mode.isInShareExtension { if viewModel.mode.isInShareExtension {
currentAccount.setClient(client: newClient) currentAccount.setClient(client: newClient)
viewModel.client = newClient
} }
} }
} }