Skip to content

Commit 594ce5e

Browse files
fix(frontend-search): path is undefined fixed (#153)
1 parent d727d59 commit 594ce5e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Phonebook.Frontend/src/app/shared/states/Search.state.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ export class SearchState {
5555
!(routeSnapshot.firstChild.url[0].path === 'search')
5656
) {
5757
// Do not reset search if navigated to user
58-
if (!(routeSnapshot.firstChild && routeSnapshot.firstChild.url[0].path === 'user')) {
58+
if (
59+
!(
60+
routeSnapshot.firstChild &&
61+
routeSnapshot.firstChild.url.length !== 0 &&
62+
routeSnapshot.firstChild.url[0].path === 'user'
63+
)
64+
) {
5965
this.store.dispatch(new ResetSearch(false));
6066
}
6167
return;

0 commit comments

Comments
 (0)