Conversation
| }, [props]) | ||
|
|
||
| const getCurrentUrl = () => { | ||
| const currentURL = window.location.pathname.split('/')[1]; |
There was a problem hiding this comment.
for me, the process terminates when I just go to /positions, because ReferenceError: window is not defined here. Not sure what's up with that – @bronz3beard, does it not happen for you?
There was a problem hiding this comment.
… because for server-side rendering, there is no window … 🤔
There was a problem hiding this comment.
I think on the second render it should exist client side, it didn't cause me an issue but I will try to get it sorted 😃 so it works for us all!!
There was a problem hiding this comment.
it didn't cause you an issue because probably you navigate to positions, so it was always on client-side...if you reload positions, even better a hard reload, it should throw the error...we need to validate if window variable exists...so you can do:
if (typeof window !== 'undefined') { ... }
There was a problem hiding this comment.
I couldn't reproduce the error in firefox/chrome but either way i should check for window! thanks team.
kbardi
left a comment
There was a problem hiding this comment.
Looks good but I found some pending validations that could generate some errors, and some improvements.
| }, [props]) | ||
|
|
||
| const getCurrentUrl = () => { | ||
| const currentURL = window.location.pathname.split('/')[1]; |
There was a problem hiding this comment.
it didn't cause you an issue because probably you navigate to positions, so it was always on client-side...if you reload positions, even better a hard reload, it should throw the error...we need to validate if window variable exists...so you can do:
if (typeof window !== 'undefined') { ... }
|
I close it because I merged it on the new architecture (branch |
resolves #4
Reference of original issue from website-v4 'Redirect links to missing job listings to jobs? #768'
Reference for original PR 'Feature/positions missing redirect v2 #923'
Testing link:
/positions/reco6YkMgTONSB3mS/hoodie-day-apparel-ambassadorThis should have the same behaviour as website-v4 and should replicate all PR review changes, if anything is missing from previous PR let me know.