From 881816730c8286ce4d4769d27b881a95bb4a6eea Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Fri, 17 Feb 2023 14:02:05 +0100 Subject: [PATCH] Composer: Disable in app account switching --- .../Sources/Status/Editor/StatusEditorView.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift index c1d5d6d8..c8206fda 100644 --- a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift +++ b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift @@ -91,7 +91,6 @@ public struct StatusEditorView: View { } } .onChange(of: currentAccount.account?.id, perform: { _ in - viewModel.client = client viewModel.currentAccount = currentAccount.account }) .background(theme.primaryBackgroundColor) @@ -230,12 +229,16 @@ public struct StatusEditorView: View { private var accountHeaderView: some View { if let account = currentAccount.account, !viewModel.mode.isEditing { HStack { - AppAccountsSelectorView(routerPath: RouterPath(), - accountCreationEnabled: false, - avatarSize: .status) + if viewModel.mode.isInShareExtension { + AppAccountsSelectorView(routerPath: RouterPath(), + accountCreationEnabled: false, + avatarSize: .status) + } else { + AvatarView(url: account.avatar, size: .status) + } VStack(alignment: .leading, spacing: 4) { privacyMenu - Text("@\(account.acct)@\(client.server)") + Text("@\(account.acct)@\(appAccounts.currentClient.server)") .font(.scaledFootnote) .foregroundColor(.gray) }