Compare commits
No commits in common. "bf6dfab1218205d70cc311d6167197cd4cfba1f7" and "06f761bf56b188458b3b05f93abd602e7493f373" have entirely different histories.
bf6dfab121
...
06f761bf56
|
@ -49,9 +49,7 @@ class AttachmentRowController: ViewController {
|
|||
|
||||
private func removeAttachment() {
|
||||
withAnimation {
|
||||
var newAttachments = parent.draft.draftAttachments
|
||||
newAttachments.removeAll(where: { $0.id == attachment.id })
|
||||
parent.draft.attachments = NSMutableOrderedSet(array: newAttachments)
|
||||
parent.draft.attachments.remove(attachment)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,8 +70,8 @@ class AttachmentRowController: ViewController {
|
|||
private func recognizeText() {
|
||||
descriptionMode = .recognizingText
|
||||
|
||||
self.attachment.getData(features: self.parent.mastodonController.instanceFeatures, skipAllConversion: true) { result in
|
||||
DispatchQueue.main.async {
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
self.attachment.getData(features: self.parent.mastodonController.instanceFeatures, skipAllConversion: true) { result in
|
||||
let data: Data
|
||||
switch result {
|
||||
case .success((let d, _)):
|
||||
|
|
|
@ -22,11 +22,10 @@ struct LanguagePicker: View {
|
|||
}
|
||||
|
||||
static func codeFromInputMode(_ mode: UITextInputMode) -> Locale.LanguageCode? {
|
||||
guard let bcp47Lang = mode.primaryLanguage,
|
||||
!bcp47Lang.isEmpty else {
|
||||
guard let bcp47Lang = mode.primaryLanguage else {
|
||||
return nil
|
||||
}
|
||||
var maybeIso639Code = bcp47Lang[..<bcp47Lang.index(bcp47Lang.startIndex, offsetBy: min(3, bcp47Lang.count))]
|
||||
var maybeIso639Code = bcp47Lang[..<bcp47Lang.index(bcp47Lang.startIndex, offsetBy: 3)]
|
||||
if maybeIso639Code.last == "-" {
|
||||
maybeIso639Code = maybeIso639Code[..<maybeIso639Code.index(before: maybeIso639Code.endIndex)]
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
|
|||
explore.loadViewIfNeeded()
|
||||
|
||||
let search = secondaryNavController.viewControllers.first as! InlineTrendsViewController
|
||||
if search.searchController?.isActive == true {
|
||||
if search.searchController.isActive {
|
||||
// Copy the search query from the search VC to the Explore VC's search controller.
|
||||
let query = search.searchController.searchBar.text ?? ""
|
||||
explore.searchController.searchBar.text = query
|
||||
|
|
|
@ -240,9 +240,7 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell {
|
|||
|
||||
override var accessibilityLabel: String? {
|
||||
get {
|
||||
guard let first = group.notifications.first else {
|
||||
return nil
|
||||
}
|
||||
let first = group.notifications.first!
|
||||
var str = ""
|
||||
switch group.kind {
|
||||
case .favourite:
|
||||
|
|
|
@ -263,9 +263,6 @@ class NotificationsCollectionViewController: UIViewController, TimelineLikeColle
|
|||
return
|
||||
}
|
||||
var snapshot = dataSource.snapshot()
|
||||
guard snapshot.sectionIdentifiers.contains(.notifications) else {
|
||||
return
|
||||
}
|
||||
let items = snapshot.itemIdentifiers(inSection: .notifications)
|
||||
let toDelete = statusIDs.flatMap { id in
|
||||
items.lazy.filter { $0.group?.notifications.first?.status?.id == id }
|
||||
|
|
|
@ -77,11 +77,7 @@ struct TipJarView: View {
|
|||
}
|
||||
}
|
||||
.onPreferenceChange(ButtonWidthKey.self) { newValue in
|
||||
if let buttonWidth {
|
||||
self.buttonWidth = max(buttonWidth, newValue)
|
||||
} else {
|
||||
self.buttonWidth = newValue
|
||||
}
|
||||
self.buttonWidth = newValue
|
||||
}
|
||||
|
||||
if let total = getTotalTips(), total > 0 {
|
||||
|
|
|
@ -105,11 +105,7 @@ class PollOptionsView: UIControl {
|
|||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
// don't let subviews receive touch events
|
||||
if isEnabled {
|
||||
return self
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
// MARK: - UIControl
|
||||
|
|
|
@ -32,12 +32,10 @@ class PollVoteButton: UIView {
|
|||
|
||||
button.translatesAutoresizingMaskIntoConstraints = false
|
||||
button.setTitleColor(.secondaryLabel, for: .disabled)
|
||||
button.contentHorizontalAlignment = .trailing
|
||||
embedSubview(button)
|
||||
#if targetEnvironment(macCatalyst)
|
||||
label.textColor = .secondaryLabel
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
label.textAlignment = .right
|
||||
embedSubview(label)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ class StatusPollView: UIView, StatusContentPollView {
|
|||
voteButton.translatesAutoresizingMaskIntoConstraints = false
|
||||
voteButton.addTarget(self, action: #selector(votePressed))
|
||||
voteButton.setFont(infoLabel.font)
|
||||
voteButton.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
|
||||
addSubview(voteButton)
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
|
@ -78,7 +77,7 @@ class StatusPollView: UIView, StatusContentPollView {
|
|||
infoLabel.leadingAnchor.constraint(equalTo: leadingAnchor),
|
||||
infoLabel.topAnchor.constraint(equalTo: optionsView.bottomAnchor),
|
||||
infoLabel.bottomAnchor.constraint(equalTo: bottomAnchor),
|
||||
infoLabel.trailingAnchor.constraint(equalTo: voteButton.leadingAnchor, constant: -8),
|
||||
infoLabel.trailingAnchor.constraint(lessThanOrEqualTo: voteButton.leadingAnchor, constant: -8),
|
||||
|
||||
voteButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 44),
|
||||
voteButton.trailingAnchor.constraint(equalTo: trailingAnchor),
|
||||
|
@ -142,7 +141,7 @@ class StatusPollView: UIView, StatusContentPollView {
|
|||
}
|
||||
|
||||
func estimateHeight(effectiveWidth: CGFloat) -> CGFloat {
|
||||
guard poll != nil else { return 0 }
|
||||
guard let poll else { return 0 }
|
||||
return optionsView.estimateHeight(effectiveWidth: effectiveWidth) + infoLabel.sizeThatFits(UIView.layoutFittingExpandedSize).height
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,6 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
|
|||
]).configure {
|
||||
$0.axis = .horizontal
|
||||
$0.spacing = 8
|
||||
$0.distribution = .fillProportionally
|
||||
}
|
||||
|
||||
private let timestampAndClientLabel = UILabel().configure {
|
||||
|
@ -327,12 +326,7 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
|
|||
}
|
||||
|
||||
override func updateConfiguration(using state: UICellConfigurationState) {
|
||||
var config = UIBackgroundConfiguration.listPlainCell().updated(for: state)
|
||||
// conv main status isn't selectable
|
||||
if !state.isFocused {
|
||||
config.backgroundColor = .appBackground
|
||||
}
|
||||
backgroundConfiguration = config
|
||||
backgroundConfiguration = .appListPlainCell(for: state)
|
||||
}
|
||||
|
||||
// MARK: Configure UI
|
||||
|
|
|
@ -784,8 +784,7 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
}
|
||||
|
||||
func contextMenuConfiguration() -> UIContextMenuConfiguration? {
|
||||
guard let mastodonController,
|
||||
let status = mastodonController.persistentContainer.status(for: statusID) else {
|
||||
guard let status = mastodonController.persistentContainer.status(for: statusID) else {
|
||||
return nil
|
||||
}
|
||||
return UIContextMenuConfiguration {
|
||||
|
|
Loading…
Reference in New Issue