Browse Source

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

ErnestoOrtiz2 2 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,7 +23,7 @@ export function Cita({route, navigation}) {
23 23
  useEffect(() => { 
24 24
     const fire = firebase.firestore()
25 25
     .collection('THREADS')
26
-    .where("cita", "==", route.params)
26
+    .where("cita", "==", route.params.tag._id)
27 27
     .onSnapshot(querySnapshot => {
28 28
       const threads = querySnapshot.docs.map(documentSnapshot => {
29 29
         return{
@@ -46,8 +46,7 @@ export function Cita({route, navigation}) {
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,7 +45,7 @@ export function Home_page({navigation}) {
45 45
     });
46 46
 
47 47
     responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
48
-      console.log(response);
48
+      console.log("response", response);
49 49
       if (response.notification.request.content.body == 'Le solicitan una cita'){
50 50
         navigation.navigate('Confirm');
51 51
       } 
@@ -129,7 +129,7 @@ export function Home_page({navigation}) {
129 129
   }
130 130
   
131 131
   check_user_type_INT();
132
-  console.log(interpreter);
132
+  console.log("interpreter", interpreter);
133 133
   if(interpreter == false){
134 134
     return (
135 135
       <ImageBackground style={styles.stdcontainer} source={require('../../assets/yellow-white.jpg')}>
@@ -143,7 +143,7 @@ export function Home_page({navigation}) {
143 143
         renderItem = {({item}) => (
144 144
         <TouchableOpacity
145 145
         onPress={async () => {
146
-          console.log(item._id)
146
+          console.log("item._id, home, client", item._id)
147 147
           navigation.navigate('Cita',{tag: item})
148 148
         }}
149 149
         >
@@ -179,7 +179,7 @@ export function Home_page({navigation}) {
179 179
           keyExtractor = {item => item._id}
180 180
           ItemSeparatorComponent={() => <Divider />}
181 181
           renderItem={({ item }) => {
182
-            if(item.new){
182
+            if(item.new == 'true'){
183 183
             return (
184 184
               <Button
185 185
               title ='Pedir Cita'
@@ -215,7 +215,7 @@ export function Home_page({navigation}) {
215 215
           renderItem = {({item}) => (
216 216
           <TouchableOpacity
217 217
           onPress={async () => {
218
-            console.log(item._id)
218
+            console.log("item._id, home, interpreter", item._id)
219 219
             navigation.navigate('Cita',{tag: item})
220 220
           }}
221 221
           >
@@ -252,7 +252,7 @@ export function Home_page({navigation}) {
252 252
             data={appointments}
253 253
             keyExtractor = {item => item._id}
254 254
             renderItem={({ item }) => {
255
-            if(item.new == true){
255
+            if(item.new == 'true'){
256 256
             return (
257 257
               <Button
258 258
                 title ='Pedir Cita'
@@ -313,8 +313,7 @@ async function registerForPushNotificationsAsync() {
313 313
       return;
314 314
     }
315 315
     token = (await Notifications.getExpoPushTokenAsync()).data;
316
-    console.log('Token:')
317
-    console.log(token);
316
+    console.log('Token:', token)
318 317
   } else {
319 318
     alert('Must use physical device for Push Notifications');
320 319
   }