Various improvements

This commit is contained in:
Isaac
2024-04-23 12:57:38 +04:00
parent 8db274cb50
commit 8e043a3a7d
28 changed files with 530 additions and 43 deletions

View File

@@ -752,6 +752,7 @@ final class OverscrollContentsComponent: Component {
let foregroundColor: UIColor
let peer: EnginePeer?
let threadData: ChatOverscrollThreadData?
let isForumThread: Bool
let unreadCount: Int
let location: TelegramEngine.NextUnreadChannelLocation
let expandOffset: CGFloat
@@ -766,6 +767,7 @@ final class OverscrollContentsComponent: Component {
foregroundColor: UIColor,
peer: EnginePeer?,
threadData: ChatOverscrollThreadData?,
isForumThread: Bool,
unreadCount: Int,
location: TelegramEngine.NextUnreadChannelLocation,
expandOffset: CGFloat,
@@ -779,6 +781,7 @@ final class OverscrollContentsComponent: Component {
self.foregroundColor = foregroundColor
self.peer = peer
self.threadData = threadData
self.isForumThread = isForumThread
self.unreadCount = unreadCount
self.location = location
self.expandOffset = expandOffset
@@ -804,6 +807,9 @@ final class OverscrollContentsComponent: Component {
if lhs.threadData != rhs.threadData {
return false
}
if lhs.isForumThread != rhs.isForumThread {
return false
}
if lhs.unreadCount != rhs.unreadCount {
return false
}
@@ -965,6 +971,9 @@ final class OverscrollContentsComponent: Component {
titleText = threadData.data.info.title
} else if let peer = component.peer {
titleText = peer.compactDisplayTitle
} else if component.isForumThread {
//TODO:localize
titleText = "You have no unread topics"
} else {
titleText = component.context.sharedContext.currentPresentationData.with({ $0 }).strings.Chat_NavigationNoChannels
}
@@ -1083,6 +1092,7 @@ public final class ChatOverscrollControl: CombinedComponent {
let foregroundColor: UIColor
let peer: EnginePeer?
let threadData: ChatOverscrollThreadData?
let isForumThread: Bool
let unreadCount: Int
let location: TelegramEngine.NextUnreadChannelLocation
let context: AccountContext
@@ -1097,6 +1107,7 @@ public final class ChatOverscrollControl: CombinedComponent {
foregroundColor: UIColor,
peer: EnginePeer?,
threadData: ChatOverscrollThreadData?,
isForumThread: Bool,
unreadCount: Int,
location: TelegramEngine.NextUnreadChannelLocation,
context: AccountContext,
@@ -1110,6 +1121,7 @@ public final class ChatOverscrollControl: CombinedComponent {
self.foregroundColor = foregroundColor
self.peer = peer
self.threadData = threadData
self.isForumThread = isForumThread
self.unreadCount = unreadCount
self.location = location
self.context = context
@@ -1133,6 +1145,9 @@ public final class ChatOverscrollControl: CombinedComponent {
if lhs.threadData != rhs.threadData {
return false
}
if lhs.isForumThread != rhs.isForumThread {
return false
}
if lhs.unreadCount != rhs.unreadCount {
return false
}
@@ -1171,6 +1186,7 @@ public final class ChatOverscrollControl: CombinedComponent {
foregroundColor: context.component.foregroundColor,
peer: context.component.peer,
threadData: context.component.threadData,
isForumThread: context.component.isForumThread,
unreadCount: context.component.unreadCount,
location: context.component.location,
expandOffset: context.component.expandDistance,