Skip to content

Commit d1f0c22

Browse files
Rerender recommendations when user updates their skills, error handling of message after getting matched
1 parent e8fabc5 commit d1f0c22

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Frontend/components/Discover.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,14 @@ function Discover() {
124124
});
125125
if (res.data === 'Matched') {
126126
console.log('Matched');
127-
const msg = await axiosInstance.post('/message', {
128-
Receiver_ID: cards[index].id,
129-
text: 'Hi, 👋 We matched up',
130-
});
127+
try {
128+
const msg = await axiosInstance.post('/message', {
129+
Receiver_ID: cards[index].id,
130+
text: 'Hi, 👋 We matched up',
131+
});
132+
} catch (err) {
133+
console.log(err);
134+
}
131135
} else {
132136
console.log('Yet to Match');
133137
}
@@ -187,7 +191,7 @@ function Discover() {
187191
};
188192

189193
init();
190-
}, [filtered_skills]);
194+
}, [filtered_skills, user.skills]);
191195

192196
return (
193197
<View style={styles.container}>

0 commit comments

Comments
 (0)