From 662165f1d32437aa5337df3270971a8bcf13dd03 Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Fri, 9 Jun 2023 14:33:13 +0000 Subject: [PATCH] use haptic feedback on default button --- packages/app/src/cores/sound/sound.core.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app/src/cores/sound/sound.core.js b/packages/app/src/cores/sound/sound.core.js index d0798911..b7077b8c 100755 --- a/packages/app/src/cores/sound/sound.core.js +++ b/packages/app/src/cores/sound/sound.core.js @@ -3,6 +3,7 @@ import { Howl } from "howler" import config from "config" import axios from "axios" import store from "store" +import { Haptics, ImpactStyle } from "@capacitor/haptics" export default class SoundCore extends Core { static refName = "sound" @@ -77,7 +78,11 @@ export default class SoundCore extends Core { // if button exist and has aria-checked attribute then play switch_on or switch_off if (button) { if (button.hasAttribute("aria-checked")) { - return this.public.useUIAudio(button.getAttribute("aria-checked") === "true" ? "component.slider_down" : "component.slider_up") + return this.public.useUIAudio(button.getAttribute("aria-checked") === "true" ? "component.slider_down" : "component.slider_up") + } + + if (app.cores.settings.get("haptic_feedback")) { + Haptics.impact({ style: ImpactStyle.Medium }) } return this.public.useUIAudio("generic_click")