mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
use haptic feedback on default button
This commit is contained in:
parent
27bfeb7146
commit
662165f1d3
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user