fix(all): use proper undefined check when using Haptics plugin (#21156)

fixes #21148
This commit is contained in:
Liam DeBeasi
2020-04-29 13:13:28 -04:00
committed by GitHub
parent fc2be8d08b
commit c53b136dbe

View File

@ -10,7 +10,7 @@ interface HapticNotificationOptions {
const HapticEngine = { const HapticEngine = {
getEngine() { getEngine() {
const win = (window as any); const win = (window as any);
return (win.TapticEngine) || (win.Capacitor && win.Capacitor.Plugins.Haptics); return (win.TapticEngine) || (win.Capacitor && win.Capacitor.isPluginAvailable('Haptics') && win.Capacitor.Plugins.Haptics);
}, },
available() { available() {
return !!this.getEngine(); return !!this.getEngine();