Skip to content

Commit

Permalink
fix: 🐛 Sentry error Cannot read property 'nom' of undefined
Browse files Browse the repository at this point in the history
Closes: #1724
  • Loading branch information
benguedj committed Aug 28, 2023
1 parent 30b66f4 commit b01852f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 2 additions & 6 deletions front/src/components/links/linksHandler.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const enum DeepLinksPages {
const LinksHandler: FC = () => {
const redirectDeepLink = async (url: string) => {
const { path, queryParams } = Linking.parse(url);
if (path === Linking.parse(Links.deepLinkUrl).path) {
if (path === Linking.parse(Links.deepLinkUrl).path && queryParams) {
// TODO: à améliorer
// Sauvegarde du scrollToEventId car les params ne sont pas pris en compte lors de cette redirection
// Il est possible de les prendre en compte mais il y un soucis pour reset les params de la route.
// Lorsque l'on clique sur le tabCalendar c'est le bottomTab qui gère la navigation et conserve les params de la route...
if (queryParams.page === DeepLinksPages.event && queryParams?.id) {
if (queryParams.page === DeepLinksPages.event && queryParams.id) {
await StorageUtils.storeStringValue(
StorageKeysConstants.scrollToEventId,
queryParams.id as string
Expand Down Expand Up @@ -53,10 +53,6 @@ const LinksHandler: FC = () => {
.catch((err) => {
console.error("An error occurred", err);
});

return () => {
Linking.removeEventListener("url", handleOpenURL);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down
4 changes: 1 addition & 3 deletions front/src/screens/articles/articleListScreen.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ const ArticleListScreen: FC<Props> = ({ navigation, route }) => {
return (
<View style={styles.mainContainer}>
<TrackerHandler
screenName={TrackerUtils.trackerArticlesScreenName(
route.params.step.nom
)}
screenName={TrackerUtils.trackerArticlesScreenName(screenTitle)}
actionName={trackerAction}
/>
{showArticles && (
Expand Down

0 comments on commit b01852f

Please sign in to comment.