mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
fix(all): use proper undefined check when using Haptics plugin (#21156)
fixes #21148
This commit is contained in:
@ -10,7 +10,7 @@ interface HapticNotificationOptions {
|
||||
const HapticEngine = {
|
||||
getEngine() {
|
||||
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() {
|
||||
return !!this.getEngine();
|
||||
|
Reference in New Issue
Block a user