Skip to content

Conversation

@vovameister
Copy link
Member

No description provided.

Copy link
Member

@Lainaaa Lainaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not it be easier just to make Task.sleep instead of this hard logic?

@vovameister vovameister force-pushed the trello.com/c/sG80IZan branch from 64d1e1c to 0140920 Compare May 28, 2025 16:23
@vovameister vovameister requested a review from Lainaaa May 28, 2025 16:24
@vovameister
Copy link
Member Author

Should not it be easier just to make Task.sleep instead of this hard logic?
what's the difference, and don't you think that managing a task and restarting the timer is more problematic than just using subject + debounce?

@art-divin art-divin requested a review from Copilot May 28, 2025 19:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR delays the badge update for the current chat to prevent immediate changes when a user is actively reading messages.

  • Introduces a new property to track the currently selected chat room.
  • Implements a debounced badge update using a new ObservableSender subject.
  • Adds a delay constant to control the update timing.
Comments suppressed due to low confidence (1)

Adamant/Modules/ChatsList/ChatListViewController.swift:1697

  • The variable name 'currentChatBudgeUpdateDelay' appears to contain a spelling mistake; consider renaming it to 'currentChatBadgeUpdateDelay' for clarity.
fileprivate let currentChatBudgeUpdateDelay: TimeInterval = 1.0

case let c where c == chatsController:
tableView.endUpdates()

case let c where c == unreadController:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for the sake of clarity, we can rename c to controller as intended

@vovameister vovameister merged commit 365cac0 into release/3.11.0 May 28, 2025
9 checks passed
@vovameister vovameister deleted the trello.com/c/sG80IZan branch May 28, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants