Fix two issues related to share extension (#85)
* Share sheet: fix EnvironmentObject related crash * Editor: fix the logic of canPost
This commit is contained in:
parent
03749cd89e
commit
96344e2815
|
@ -13,7 +13,8 @@ class ShareViewController: UIViewController {
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
let client = AppAccountsManager.shared.currentClient
|
||||
let appAccountsManager = AppAccountsManager.shared
|
||||
let client = appAccountsManager.currentClient
|
||||
let account = CurrentAccount.shared
|
||||
let instance = CurrentInstance.shared
|
||||
account.setClient(client: client)
|
||||
|
@ -26,6 +27,7 @@ class ShareViewController: UIViewController {
|
|||
if let attachments = item.attachments {
|
||||
let view = StatusEditorView(mode: .shareExtension(items: attachments))
|
||||
.environmentObject(UserPreferences.shared)
|
||||
.environmentObject(appAccountsManager)
|
||||
.environmentObject(client)
|
||||
.environmentObject(account)
|
||||
.environmentObject(theme)
|
||||
|
|
|
@ -52,7 +52,7 @@ public class StatusEditorViewModel: ObservableObject {
|
|||
@Published var replyToStatus: Status?
|
||||
@Published var embededStatus: Status?
|
||||
var canPost: Bool {
|
||||
statusText.length > 0 || !selectedMedias.isEmpty
|
||||
statusText.length > 0 || !mediasImages.isEmpty
|
||||
}
|
||||
|
||||
var shouldDisablePollButton: Bool {
|
||||
|
|
Loading…
Reference in New Issue