mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-29 19:51:08 +00:00
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
2 changed files with 4 additions and 2 deletions
|
@ -13,7 +13,8 @@ class ShareViewController: UIViewController {
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
let client = AppAccountsManager.shared.currentClient
|
let appAccountsManager = AppAccountsManager.shared
|
||||||
|
let client = appAccountsManager.currentClient
|
||||||
let account = CurrentAccount.shared
|
let account = CurrentAccount.shared
|
||||||
let instance = CurrentInstance.shared
|
let instance = CurrentInstance.shared
|
||||||
account.setClient(client: client)
|
account.setClient(client: client)
|
||||||
|
@ -26,6 +27,7 @@ class ShareViewController: UIViewController {
|
||||||
if let attachments = item.attachments {
|
if let attachments = item.attachments {
|
||||||
let view = StatusEditorView(mode: .shareExtension(items: attachments))
|
let view = StatusEditorView(mode: .shareExtension(items: attachments))
|
||||||
.environmentObject(UserPreferences.shared)
|
.environmentObject(UserPreferences.shared)
|
||||||
|
.environmentObject(appAccountsManager)
|
||||||
.environmentObject(client)
|
.environmentObject(client)
|
||||||
.environmentObject(account)
|
.environmentObject(account)
|
||||||
.environmentObject(theme)
|
.environmentObject(theme)
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class StatusEditorViewModel: ObservableObject {
|
||||||
@Published var replyToStatus: Status?
|
@Published var replyToStatus: Status?
|
||||||
@Published var embededStatus: Status?
|
@Published var embededStatus: Status?
|
||||||
var canPost: Bool {
|
var canPost: Bool {
|
||||||
statusText.length > 0 || !selectedMedias.isEmpty
|
statusText.length > 0 || !mediasImages.isEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
var shouldDisablePollButton: Bool {
|
var shouldDisablePollButton: Bool {
|
||||||
|
|
Loading…
Reference in a new issue