Fix exception with navigator.vibrate() on start up

This commit is contained in:
redphx
2024-06-22 16:43:18 +07:00
parent 11ef014c74
commit 057da5b3ea
2 changed files with 8 additions and 8 deletions

View File

@@ -128,19 +128,19 @@ function setupStreamSettingsDialog() {
{
pref: PrefKey.CONTROLLER_ENABLE_VIBRATION,
unsupported: !VibrationManager.supportControllerVibration(),
onChange: VibrationManager.updateGlobalVars,
onChange: () => VibrationManager.updateGlobalVars(),
},
{
pref: PrefKey.CONTROLLER_DEVICE_VIBRATION,
unsupported: !VibrationManager.supportDeviceVibration(),
onChange: VibrationManager.updateGlobalVars,
onChange: () => VibrationManager.updateGlobalVars(),
},
(VibrationManager.supportControllerVibration() || VibrationManager.supportDeviceVibration()) && {
pref: PrefKey.CONTROLLER_VIBRATION_INTENSITY,
unsupported: !VibrationManager.supportDeviceVibration(),
onChange: VibrationManager.updateGlobalVars,
onChange: () => VibrationManager.updateGlobalVars(),
},
],
},