mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-13 12:34:16 +00:00
34 lines
918 B
JavaScript
Executable File
34 lines
918 B
JavaScript
Executable File
import { Haptics, ImpactStyle } from "@capacitor/haptics"
|
|
|
|
export default {
|
|
selectionStart: async () => {
|
|
const enabled = window.app.cores.settings.get("haptic_feedback")
|
|
|
|
if (enabled) {
|
|
await Haptics.selectionStart()
|
|
}
|
|
},
|
|
selectionChanged: async () => {
|
|
const enabled = window.app.cores.settings.get("haptic_feedback")
|
|
|
|
if (enabled) {
|
|
await Haptics.selectionChanged()
|
|
}
|
|
},
|
|
selectionEnd: async () => {
|
|
const enabled = window.app.cores.settings.get("haptic_feedback")
|
|
|
|
if (enabled) {
|
|
await Haptics.selectionEnd()
|
|
}
|
|
},
|
|
impact: async (style = "Medium") => {
|
|
const enabled = window.app.cores.settings.get("haptic_feedback")
|
|
|
|
if (enabled) {
|
|
style = String(style).toTitleCase()
|
|
|
|
await Haptics.impact({ style: ImpactStyle[style] })
|
|
}
|
|
}
|
|
} |