Skip to content

Commit

Permalink
1.8.8 (365)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Nov 6, 2024
1 parent 4144ea4 commit 55378ae
Showing 8 changed files with 58 additions and 34 deletions.
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@
"location" : "[email protected]:mobyrix/nicegram-assistant-ios.git",
"state" : {
"branch" : "develop",
"revision" : "37f0d0308281266b5b258988706a1dfd882fb429"
"revision" : "4eb72eaad64401896500eef247aa6bfc2dc97f32"
}
},
{
@@ -123,7 +123,7 @@
"location" : "[email protected]:mobyrix/nicegram-wallet-ios.git",
"state" : {
"branch" : "develop",
"revision" : "9196ef088891b7ce6647e38d41c901b62f38dd8c"
"revision" : "6417219110dae50a9dd129c61795dc469ceb12d0"
}
},
{
@@ -338,8 +338,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/trustwallet/wallet-core.git",
"state" : {
"revision" : "f6d8a10d749dd70fbd08bb098db550810bca34f5",
"version" : "4.1.15"
"revision" : "c4907d444673e7eb4c131b67ce2ced5b2d2cb09e",
"version" : "4.1.16"
}
},
{
2 changes: 1 addition & 1 deletion build-system/bazel-rules/rules_swift
Submodule rules_swift updated 179 files
8 changes: 4 additions & 4 deletions submodules/ChatListUI/Sources/ChatListController.swift
Original file line number Diff line number Diff line change
@@ -2245,7 +2245,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
super.viewDidAppear(animated)

// MARK: Nicegram PinnedChats
updateChatListNode(isOnScreen: true)
updateChatListNode(isVisible: true)
//

// MARK: Nicegram
@@ -2679,7 +2679,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
super.viewDidDisappear(animated)

// MARK: Nicegram PinnedChats
updateChatListNode(isOnScreen: false)
updateChatListNode(isVisible: false)
//

if self.dismissSearchOnDisappear {
@@ -2702,8 +2702,8 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
}

// MARK: Nicegram PinnedChats
private func updateChatListNode(isOnScreen: Bool) {
chatListDisplayNode.effectiveContainerNode.currentItemNode.isOnScreen.value = isOnScreen
private func updateChatListNode(isVisible: Bool) {
chatListDisplayNode.effectiveContainerNode.currentItemNode.isChatListVisible.value = isVisible
}
//

24 changes: 17 additions & 7 deletions submodules/ChatListUI/Sources/Node/ChatListItem.swift
Original file line number Diff line number Diff line change
@@ -1485,18 +1485,28 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode {
self.authorNode.visibilityStatus = self.visibilityStatus

// MARK: Nicegram ATT
if self.visibilityStatus, let item {
if let attAd = item.attAd {
item.attBannerFeature.onView(ad: attAd)
} else if let nicegramItem = item.nicegramItem {
PinnedChatsUI.trackChatView(nicegramItem.chat)
}
}
trackViewIfNeeded()
//
}
}
}

// MARK: Nicegram ATT
public func trackViewIfNeeded() {
guard self.visibilityStatus,
let item,
item.interaction.isChatListVisible() else {
return
}

if let attAd = item.attAd {
item.attBannerFeature.onView(ad: attAd)
} else if let nicegramItem = item.nicegramItem {
PinnedChatsUI.trackChatView(nicegramItem.chat)
}
}
//

private var trackingIsInHierarchy: Bool = false {
didSet {
if self.trackingIsInHierarchy != oldValue {
35 changes: 22 additions & 13 deletions submodules/ChatListUI/Sources/Node/ChatListNode.swift
Original file line number Diff line number Diff line change
@@ -86,6 +86,7 @@ public final class ChatListNodeInteraction {

// MARK: Nicegram PinnedChats
let clearHighlightAnimated: (Bool) -> Void
let isChatListVisible: () -> Bool
//

let peerSelected: (EnginePeer, EnginePeer?, Int64?, ChatListNodeEntryPromoInfo?) -> Void
@@ -146,6 +147,7 @@ public final class ChatListNodeInteraction {
activateSearch: @escaping () -> Void,
// MARK: Nicegram PinnedChats
clearHighlightAnimated: @escaping (Bool) -> Void = { _ in },
isChatListVisible: @escaping () -> Bool = { false },
//
peerSelected: @escaping (EnginePeer, EnginePeer?, Int64?, ChatListNodeEntryPromoInfo?) -> Void,
disabledPeerSelected: @escaping (EnginePeer, Int64?, ChatListDisabledPeerReason) -> Void,
@@ -190,6 +192,7 @@ public final class ChatListNodeInteraction {
self.activateSearch = activateSearch
// MARK: Nicegram PinnedChats
self.clearHighlightAnimated = clearHighlightAnimated
self.isChatListVisible = isChatListVisible
//
self.peerSelected = peerSelected
self.disabledPeerSelected = disabledPeerSelected
@@ -1277,7 +1280,8 @@ public final class ChatListNode: ListView {
private var enqueuedTransition: (ChatListNodeListViewTransition, () -> Void)?

// MARK: Nicegram PinnedChats
public let isOnScreen = CurrentValueSubject<Bool, Never>(false)
private let getPinnedChatsToDisplayUseCase = PinnedChatsContainer.shared.getPinnedChatsToDisplayUseCase()
public let isChatListVisible = CurrentValueSubject<Bool, Never>(false)
private var cancellables = Set<AnyCancellable>()
//

@@ -1426,6 +1430,8 @@ public final class ChatListNode: ListView {
// MARK: Nicegram PinnedChats
}, clearHighlightAnimated: { [weak self] flag in
self?.clearHighlightAnimated(flag)
}, isChatListVisible: { [weak self] in
self?.isChatListVisible.value ?? false
//
}, peerSelected: { [weak self] peer, _, threadId, promoInfo in
if let strongSelf = self, let peerSelected = strongSelf.peerSelected {
@@ -2270,21 +2276,24 @@ public final class ChatListNode: ListView {
}

// MARK: Nicegram PinnedChats
let nicegramItems = CurrentValueSubject<[PinnedChatToDisplay], Never>([])
let nicegramItemsSignal = nicegramItems
.eraseToAnyPublisher()
let nicegramItemsSignal = getPinnedChatsToDisplayUseCase
.publisher(
isViewVisible: isChatListVisible.eraseToAnyPublisher()
)
.map { Array($0.reversed()) }
.toSignal()
.skipError()

PinnedChatsContainer.shared.getPinnedChatsToDisplayUseCase()
.publisher()
.map { $0.reversed() }
.combineLatestThreadSafe(
isOnScreen.eraseToAnyPublisher()
)
.sink { items, isOnScreen in
if isOnScreen {
nicegramItems.value = items
isChatListVisible
.removeDuplicates()
.sink { [weak self] isChatListVisible in
guard let self else { return }
if isChatListVisible {
self.forEachItemNode { itemNode in
if let itemNode = itemNode as? ChatListItemNode {
itemNode.trackViewIfNeeded()
}
}
}
}
.store(in: &cancellables)
5 changes: 5 additions & 0 deletions submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift
Original file line number Diff line number Diff line change
@@ -194,6 +194,11 @@ enum ChatListNodeEntry: Comparable, Identifiable {
}

static func ==(lhs: PeerEntryData, rhs: PeerEntryData) -> Bool {
// MARK: Nicegram PinnedChats
if lhs.nicegramItem != rhs.nicegramItem {
return false
}
//
if lhs.index != rhs.index {
return false
}

0 comments on commit 55378ae

Please sign in to comment.