Подавление уведомлений в открытом чате, ускорение переходов между экранами, инициалы на экране разблокировки, плавный keyboard offset

This commit is contained in:
2026-03-13 00:37:36 +05:00
parent c7bea82c3a
commit 7dbddb27a6
4 changed files with 14 additions and 11 deletions

View File

@@ -119,19 +119,22 @@ struct ChatDetailView: View {
.toolbar(.hidden, for: .tabBar)
.task {
isViewActive = true
// Suppress notifications & clear badge immediately (no 600ms delay).
// setDialogActive only touches MessageRepository.activeDialogs (Set),
// does NOT mutate DialogRepository, so ForEach won't rebuild.
MessageRepository.shared.setDialogActive(route.publicKey, isActive: true)
clearDeliveredNotifications(for: route.publicKey)
// Reset idle timer user is actively viewing a chat.
SessionManager.shared.recordUserInteraction()
// Request user info (non-mutating, won't trigger list rebuild)
requestUserInfoIfNeeded()
// Delay ALL dialog mutations to let navigation transition complete.
// Delay DialogRepository mutations to let navigation transition complete.
// Without this, DialogRepository update rebuilds ChatListView's ForEach
// mid-navigation, recreating the NavigationLink and canceling the push.
try? await Task.sleep(for: .milliseconds(600))
guard isViewActive else { return }
activateDialog()
markDialogAsRead()
// Clear delivered notifications from this sender
clearDeliveredNotifications(for: route.publicKey)
// Subscribe to opponent's online status (Android parity) only after settled
SessionManager.shared.subscribeToOnlineStatus(publicKey: route.publicKey)
// Desktop parity: force-refresh user info (incl. online status) on chat open.