Уведомления CarPlay, панель вложений с Lottie, фикс reply preview, плавная анимация клавиатуры, стабильность WebSocket

This commit is contained in:
2026-03-22 01:58:13 +05:00
parent 65e5991f97
commit 9289bb2efd
20 changed files with 645 additions and 172 deletions

View File

@@ -106,6 +106,21 @@ struct ChatListView: View {
guard let route = notification.object as? ChatRoute else { return }
// Navigate to the chat from push notification tap
navigationState.path = [route]
// Clear pending route consumed by onReceive (fast path)
AppDelegate.pendingChatRoute = nil
}
.onAppear {
// Fallback: consume pending route if .onReceive missed it.
// Handles terminated app (ChatListView didn't exist when notification was posted)
// and background app (Combine subscription may not fire during app resume).
if let route = AppDelegate.pendingChatRoute {
AppDelegate.pendingChatRoute = nil
// Small delay to let NavigationStack settle after view creation
Task { @MainActor in
try? await Task.sleep(nanoseconds: 100_000_000) // 100ms
navigationState.path = [route]
}
}
}
}