For some properties, like defaultZoomLvl, the supported values range between 0-100.
This change fixes the initialization when setting them to "0", which previously used the default instead, because of usage of ||. Fix this by using ?? instead. The reproduction is very simple: initialize defaultZoomLvl, minFov or maxFov to "0" and observe it instead using their default value instead of "0". Change it to "1" and observe the value being initialized correctly.
Note: For defaultYaw and defaultPitch the default is already "0", so this change doesn't make a difference, but I kept it in for correctness and consistency.
For some properties, like
defaultZoomLvl
, the supported values range between 0-100.This change fixes the initialization when setting them to "0", which previously used the default instead, because of usage of
||
. Fix this by using??
instead. The reproduction is very simple: initializedefaultZoomLvl
,minFov
ormaxFov
to "0" and observe it instead using their default value instead of "0". Change it to "1" and observe the value being initialized correctly.Codesandbox reproduction: https://codesandbox.io/p/sandbox/photo-sphere-viewer-initialization-bug-repro-ch9952?file=%2Fsrc%2FApp.js%3A65%2C1-66%2C1
Note: For
defaultYaw
anddefaultPitch
the default is already "0", so this change doesn't make a difference, but I kept it in for correctness and consistency.