feat: группы — inline карточка приглашения (Desktop/Android parity) + навигация pop→push fix

This commit is contained in:
2026-04-06 02:07:06 +05:00
parent cdb6c7e51e
commit 333908a4d9
12 changed files with 692 additions and 266 deletions

View File

@@ -135,10 +135,19 @@ struct ChatListView: View {
}
.onReceive(NotificationCenter.default.publisher(for: .openChatFromNotification)) { notification in
guard let route = notification.object as? ChatRoute else { return }
// Navigate to the chat from push notification tap (fast path)
navigationState.path = [route]
AppDelegate.pendingChatRoute = nil
AppDelegate.pendingChatRouteTimestamp = nil
// If already inside a chat, pop first then push after animation.
// Direct path replacement reuses the same ChatDetailView (SwiftUI optimization),
// which only updates the toolbar but keeps the old messages.
if !navigationState.path.isEmpty {
navigationState.path = []
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) {
navigationState.path = [route]
}
} else {
navigationState.path = [route]
}
}
.onAppear {
// Cold start fallback: ChatListView didn't exist when notification was posted.