Closed frank-weindel closed 2 years ago
Issue seems to be related to this line. When the query params are parsed, instead of using the new incoming hash
it is internally ignoring that hash and using the resumeHash
, which matches the route without the query param. I can just remove that part of the if statement, but not knowing exactly what the intent is here I'm not sure if that will break something else.
This was added to capture url parameters when a bootComponent
is configured. When it's configured the Router will navigate to $
force it to load as any other configured route.
https://github.com/rdkcentral/Lightning-SDK/blob/93c749509bb9a5db5e2888b8eed7d76ab3ac72ec/src/Router/index.js#L85 https://github.com/rdkcentral/Lightning-SDK/blob/93c749509bb9a5db5e2888b8eed7d76ab3ac72ec/src/Router/index.js#L132
Depending on the moment you call getQueryStringParams()
; getActiveHash()
can return undefined
or $
( in case of calling it in root
function ) to still be able to read the correct parameters, it uses the resumeHash
instead of the active hash: https://github.com/rdkcentral/Lightning-SDK/blob/93c749509bb9a5db5e2888b8eed7d76ab3ac72ec/src/Router/utils/helpers.js#L114
The problem seems to be in the condition; it should check if hash eq to $
or undefined
AND resumeHash
has a value
This fix is available in release 4.8.0
Thanks @erikhaandrikman
Starting with already being on a page with the route:
Manually add a URL param to the hash in the browser to look like so:
Expected: _onUrlParams'
param
is:Actual: _onUrlParams'
param
is: