Closed EmanH closed 4 months ago
Parameters should override session storage, by changing the order, this doesn't work any more. Does it?
@totaam Yes, it doesn't work. My assumption was that session params take precedence with URL params as the fallback for any undefined value. Either way makes no difference to me though, so long as URL params are being applied.
Please keep the parameters as overrides for sessionStorage
@totaam Have changed so url parameters take precedence over parameters from sessionStorage
I have made a mistake in merging this too quickly.
undefined
when it used to return null
I have some fixes pending.
@EmanH Please review the commit above. I have reviewed all the other call sites - it doesn't look like they require changes.
@totaam Technically ==
does a fuzzy compare (in JS), so in effect:
null == undefined
= truenull === undefined
= falseSo, these are equivalent:
if (v == null && prop in default_settings) {}
if (v == undefined && prop in default_settings) {}
The other change from if (v === null) {
to if (!v) {
. Is probably ok, but also fuzzy compare. So !v
would pass if v
was undefined
, null
, false
or ''
(empty string).
When assigning values, I think its best practice to consider undefined
as 'no value' and consider null
as 'a value'.
@EmanH I know the difference.
The ones in stristrue
and getboolparam
were definitely bugs caused by this change as if (v === null)
would no longer match.
The other in getparam
was changed for consistency.
Using !v
is just a shortcut, avoids converting null
, undefined
, empty-strings, False-booleans, etc.
And... another fix, these changes completely broke the connect page.
URL parameters are not being applied in connect.html or index.html. The root cause is that the
getparam()
function in Utitiles is effectively ignoring url parameters.