correct issues

This commit is contained in:
Jaanu423
2025-10-13 14:00:13 +05:30
parent ae35611bdb
commit 848032768c
9 changed files with 105 additions and 105 deletions
+1 -5
View File
@@ -18,14 +18,11 @@ const NotificationRedirection: React.FC = () => {
// This effect runs once when the component mounts
if (data) {
console.log('🔄 Processing notification data:', data);
// --- Your Redirection Logic Goes Here ---
// Use the 'data' object to decide where to go.
// For this example, we'll navigate based on 'msgType'.
let destination: keyof RootStackParamList = 'Home'; // Default destination
let params: object | undefined = undefined;
switch (data.msgType) {
case 'JOIN_REQUEST':
destination = 'Home';
@@ -62,10 +59,9 @@ const NotificationRedirection: React.FC = () => {
// Keep the default destination as 'Home'
break;
}
console.log(`➡ Redirecting to ${destination} with params:`, params);
// Use replace to prevent the user from navigating back to this loading screen
navigation.replace(destination, params);
} else {
// If no data is passed for some reason, just go to the home screen
console.warn('⚠ No data found in notification, redirecting to Home.');