Browse Source

Corregi un bug en home_page y un bug en Cita.js

ErnestoOrtiz2 3 years ago
parent
commit
38b0a0683b
2 changed files with 9 additions and 11 deletions
  1. 2
    3
      screens/main/Cita.js
  2. 7
    8
      screens/main/Home_page.js

+ 2
- 3
screens/main/Cita.js View File

23
  useEffect(() => { 
23
  useEffect(() => { 
24
     const fire = firebase.firestore()
24
     const fire = firebase.firestore()
25
     .collection('THREADS')
25
     .collection('THREADS')
26
-    .where("cita", "==", route.params)
26
+    .where("cita", "==", route.params.tag._id)
27
     .onSnapshot(querySnapshot => {
27
     .onSnapshot(querySnapshot => {
28
       const threads = querySnapshot.docs.map(documentSnapshot => {
28
       const threads = querySnapshot.docs.map(documentSnapshot => {
29
         return{
29
         return{
46
     }
46
     }
47
   }, []);
47
   }, []);
48
     
48
     
49
-    
50
-    
49
+
51
   
50
   
52
   
51
   
53
 
52
 

+ 7
- 8
screens/main/Home_page.js View File

45
     });
45
     });
46
 
46
 
47
     responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
47
     responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
48
-      console.log(response);
48
+      console.log("response", response);
49
       if (response.notification.request.content.body == 'Le solicitan una cita'){
49
       if (response.notification.request.content.body == 'Le solicitan una cita'){
50
         navigation.navigate('Confirm');
50
         navigation.navigate('Confirm');
51
       } 
51
       } 
129
   }
129
   }
130
   
130
   
131
   check_user_type_INT();
131
   check_user_type_INT();
132
-  console.log(interpreter);
132
+  console.log("interpreter", interpreter);
133
   if(interpreter == false){
133
   if(interpreter == false){
134
     return (
134
     return (
135
       <ImageBackground style={styles.stdcontainer} source={require('../../assets/yellow-white.jpg')}>
135
       <ImageBackground style={styles.stdcontainer} source={require('../../assets/yellow-white.jpg')}>
143
         renderItem = {({item}) => (
143
         renderItem = {({item}) => (
144
         <TouchableOpacity
144
         <TouchableOpacity
145
         onPress={async () => {
145
         onPress={async () => {
146
-          console.log(item._id)
146
+          console.log("item._id, home, client", item._id)
147
           navigation.navigate('Cita',{tag: item})
147
           navigation.navigate('Cita',{tag: item})
148
         }}
148
         }}
149
         >
149
         >
179
           keyExtractor = {item => item._id}
179
           keyExtractor = {item => item._id}
180
           ItemSeparatorComponent={() => <Divider />}
180
           ItemSeparatorComponent={() => <Divider />}
181
           renderItem={({ item }) => {
181
           renderItem={({ item }) => {
182
-            if(item.new){
182
+            if(item.new == 'true'){
183
             return (
183
             return (
184
               <Button
184
               <Button
185
               title ='Pedir Cita'
185
               title ='Pedir Cita'
215
           renderItem = {({item}) => (
215
           renderItem = {({item}) => (
216
           <TouchableOpacity
216
           <TouchableOpacity
217
           onPress={async () => {
217
           onPress={async () => {
218
-            console.log(item._id)
218
+            console.log("item._id, home, interpreter", item._id)
219
             navigation.navigate('Cita',{tag: item})
219
             navigation.navigate('Cita',{tag: item})
220
           }}
220
           }}
221
           >
221
           >
252
             data={appointments}
252
             data={appointments}
253
             keyExtractor = {item => item._id}
253
             keyExtractor = {item => item._id}
254
             renderItem={({ item }) => {
254
             renderItem={({ item }) => {
255
-            if(item.new == true){
255
+            if(item.new == 'true'){
256
             return (
256
             return (
257
               <Button
257
               <Button
258
                 title ='Pedir Cita'
258
                 title ='Pedir Cita'
313
       return;
313
       return;
314
     }
314
     }
315
     token = (await Notifications.getExpoPushTokenAsync()).data;
315
     token = (await Notifications.getExpoPushTokenAsync()).data;
316
-    console.log('Token:')
317
-    console.log(token);
316
+    console.log('Token:', token)
318
   } else {
317
   } else {
319
     alert('Must use physical device for Push Notifications');
318
     alert('Must use physical device for Push Notifications');
320
   }
319
   }