-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: getContextPath did not work correctly when called in a browser #3814
fix: getContextPath did not work correctly when called in a browser #3814
Conversation
Feel free to tidy up the TypeScript code, I haven't really used TypeScript before, and I'm sure it could be neater. |
Good catch |
// Determine if we are running in the browser or in node.js. If we are | ||
// running in node.js, we will have access to the process.env object, | ||
// otherwise we will have access to the window._env_ object to get the | ||
// environment variables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there is some eslint error here, i believe you would need to convert this to a multiline comment /**
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I updated the code.
@scopsy Is there any hope in moving this forward? |
@DaveAtKeelvar yes! Sorry about that, everytime I approve the test runs and then while waiting forget to come backto it to merge. Added an alarm reminder 😅 |
What change does this PR introduce?
The function
getContextPath
does not work correctly when called from inside a web browser.process.env
is only available when the function is called within node.js. When called inside a web browser, we need to instead usewindow._env_
to get access to the different context path variables.Why was this change needed?
To support custom context paths for Novu web
Other information (Screenshots)