Compare commits
2 Commits
f4b51c06c1
...
01cf597b5d
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 01cf597b5d | |
Shadowfacts | 12bab71b17 |
|
@ -454,15 +454,20 @@ extension NewMainTabBarViewController {
|
|||
extension NewMainTabBarViewController: UITabBarControllerDelegate {
|
||||
func tabBarController(_ tabBarController: UITabBarController, shouldSelectTab tab: UITab) -> Bool {
|
||||
if tab.identifier == Tab.compose.rawValue {
|
||||
let currentTab = selectedTab
|
||||
// returning false for shouldSelectTab doesn't prevent the UITabBar from being updated (FB14857254)
|
||||
// returning false and then setting selectedTab=tab and selectedTab=currentTab seems to leave things in a bad state (currentTab's VC is on screen but in the disappeared state)
|
||||
// so return true, and then after the tab bar VC has finished updating, go back to currentTab
|
||||
DispatchQueue.main.async {
|
||||
self.selectedTab = currentTab
|
||||
if #unavailable(iOS 18.1) {
|
||||
let currentTab = selectedTab
|
||||
// returning false for shouldSelectTab doesn't prevent the UITabBar from being updated (FB14857254)
|
||||
// returning false and then setting selectedTab=tab and selectedTab=currentTab seems to leave things in a bad state (currentTab's VC is on screen but in the disappeared state)
|
||||
// so return true, and then after the tab bar VC has finished updating, go back to currentTab
|
||||
DispatchQueue.main.async {
|
||||
self.selectedTab = currentTab
|
||||
}
|
||||
compose(editing: nil)
|
||||
return true
|
||||
} else {
|
||||
compose(editing: nil)
|
||||
return false
|
||||
}
|
||||
compose(editing: nil)
|
||||
return true
|
||||
} else if let selectedTab,
|
||||
selectedTab == tab,
|
||||
let nav = selectedViewController as? any NavigationControllerProtocol {
|
||||
|
|
|
@ -30,7 +30,9 @@ class AccountDisplayAndUserNameLabel: EmojiLabel {
|
|||
|
||||
private func makeAttributedText(state: State) -> NSAttributedString {
|
||||
let s = NSMutableAttributedString()
|
||||
s.append(NSAttributedString(string: state.displayName, attributes: [
|
||||
// U+2068 FIRST-STRONG ISOLATE and U+2069 POP DIRECTIONAL ISOLATE
|
||||
// to prevent bidi text in the display name influencing the username
|
||||
s.append(NSAttributedString(string: "\u{2068}\(state.displayName)\u{2069}", attributes: [
|
||||
.font: UIFont(descriptor: baseFont.addingAttributes([
|
||||
.traits: [
|
||||
UIFontDescriptor.TraitKey.weight: UIFont.Weight.semibold.rawValue,
|
||||
|
|
Loading…
Reference in New Issue