Composer: Disable in app account switching

This commit is contained in:
Thomas Ricouard 2023-02-17 14:02:05 +01:00
parent a3744525df
commit 881816730c

View file

@ -91,7 +91,6 @@ public struct StatusEditorView: View {
} }
} }
.onChange(of: currentAccount.account?.id, perform: { _ in .onChange(of: currentAccount.account?.id, perform: { _ in
viewModel.client = client
viewModel.currentAccount = currentAccount.account viewModel.currentAccount = currentAccount.account
}) })
.background(theme.primaryBackgroundColor) .background(theme.primaryBackgroundColor)
@ -230,12 +229,16 @@ public struct StatusEditorView: View {
private var accountHeaderView: some View { private var accountHeaderView: some View {
if let account = currentAccount.account, !viewModel.mode.isEditing { if let account = currentAccount.account, !viewModel.mode.isEditing {
HStack { HStack {
AppAccountsSelectorView(routerPath: RouterPath(), if viewModel.mode.isInShareExtension {
accountCreationEnabled: false, AppAccountsSelectorView(routerPath: RouterPath(),
avatarSize: .status) accountCreationEnabled: false,
avatarSize: .status)
} else {
AvatarView(url: account.avatar, size: .status)
}
VStack(alignment: .leading, spacing: 4) { VStack(alignment: .leading, spacing: 4) {
privacyMenu privacyMenu
Text("@\(account.acct)@\(client.server)") Text("@\(account.acct)@\(appAccounts.currentClient.server)")
.font(.scaledFootnote) .font(.scaledFootnote)
.foregroundColor(.gray) .foregroundColor(.gray)
} }