Compare commits
4 Commits
ad55851090
...
7b218bfd75
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 7b218bfd75 | |
Shadowfacts | 098c4254d4 | |
Shadowfacts | bbdb7fe41f | |
Shadowfacts | 3c13d2083b |
|
@ -76,7 +76,9 @@ class AttachmentsListController: ViewController {
|
|||
}
|
||||
|
||||
private func deleteAttachments(at indices: IndexSet) {
|
||||
draft.attachments.removeObjects(at: indices)
|
||||
var array = draft.draftAttachments
|
||||
array.remove(atOffsets: indices)
|
||||
draft.attachments = NSMutableOrderedSet(array: array)
|
||||
}
|
||||
|
||||
private func insertAttachments(at offset: Int, itemProviders: [NSItemProvider]) {
|
||||
|
|
|
@ -154,7 +154,7 @@ public final class ComposeController: ViewController {
|
|||
if draft.hasContent {
|
||||
isShowingSaveDraftSheet = true
|
||||
} else {
|
||||
DraftsPersistentContainer.shared.viewContext.delete(draft)
|
||||
deleteDraftOnDisappear = true
|
||||
config.dismiss(.cancel)
|
||||
}
|
||||
}
|
||||
|
@ -162,9 +162,7 @@ public final class ComposeController: ViewController {
|
|||
|
||||
@MainActor
|
||||
func cancel(deleteDraft: Bool) {
|
||||
if deleteDraft {
|
||||
DraftsPersistentContainer.shared.viewContext.delete(draft)
|
||||
}
|
||||
deleteDraftOnDisappear = true
|
||||
config.dismiss(.cancel)
|
||||
}
|
||||
|
||||
|
|
|
@ -33,17 +33,16 @@ class ShareViewController: UIViewController {
|
|||
|
||||
let context = ShareMastodonContext(accountInfo: account)
|
||||
let host = ShareHostingController(draft: draft, mastodonContext: context)
|
||||
let nav = UINavigationController(rootViewController: host)
|
||||
self.addChild(nav)
|
||||
nav.view.translatesAutoresizingMaskIntoConstraints = false
|
||||
self.view.addSubview(nav.view)
|
||||
host.view.translatesAutoresizingMaskIntoConstraints = false
|
||||
addChild(host)
|
||||
self.view.addSubview(host.view)
|
||||
NSLayoutConstraint.activate([
|
||||
nav.view.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
|
||||
nav.view.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
|
||||
nav.view.topAnchor.constraint(equalTo: self.view.topAnchor),
|
||||
nav.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
|
||||
host.view.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
|
||||
host.view.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
|
||||
host.view.topAnchor.constraint(equalTo: self.view.topAnchor),
|
||||
host.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
|
||||
])
|
||||
nav.didMove(toParent: self)
|
||||
host.didMove(toParent: self)
|
||||
}
|
||||
} else {
|
||||
state = .notLoggedIn
|
||||
|
|
|
@ -143,14 +143,16 @@ struct ReportView: View {
|
|||
.appGroupedListRowBackground()
|
||||
|
||||
Button(action: self.sendReport) {
|
||||
if isReporting {
|
||||
Text("Sending Report")
|
||||
let label = Text(isReporting ? "Sending Report" : "Send Report")
|
||||
HStack {
|
||||
label
|
||||
Spacer()
|
||||
ProgressView()
|
||||
.progressViewStyle(.circular)
|
||||
} else {
|
||||
Text("Send Report")
|
||||
if isReporting {
|
||||
ProgressView()
|
||||
.progressViewStyle(.circular)
|
||||
}
|
||||
}
|
||||
.accessibilityLabel(label)
|
||||
}
|
||||
.disabled(isReporting)
|
||||
.appGroupedListRowBackground()
|
||||
|
|
Loading…
Reference in New Issue