feat: группы — inline карточка приглашения (Desktop/Android parity) + навигация pop→push fix
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user