mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14:16 +00:00
fix haptics core api method
This commit is contained in:
parent
e3d86418a7
commit
97cbc87a81
@ -124,11 +124,11 @@ class ComtyApp extends React.Component {
|
|||||||
autoHide: false,
|
autoHide: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.app.splash = SplashScreen
|
||||||
window.app.version = config.package.version
|
window.app.version = config.package.version
|
||||||
|
|
||||||
window.localStorage.setItem("last_version", window.app.version)
|
|
||||||
|
|
||||||
window.app.message = antd.message
|
window.app.message = antd.message
|
||||||
|
|
||||||
|
window.localStorage.setItem("last_version", window.app.version)
|
||||||
|
|
||||||
// check if electron library is available
|
// check if electron library is available
|
||||||
if (typeof window.electron !== "undefined") {
|
if (typeof window.electron !== "undefined") {
|
||||||
|
@ -236,7 +236,9 @@ export class BottomBar extends React.Component {
|
|||||||
this._navTouchStart = setTimeout(() => {
|
this._navTouchStart = setTimeout(() => {
|
||||||
this.setState({ quickNavVisible: true })
|
this.setState({ quickNavVisible: true })
|
||||||
|
|
||||||
app.cores.haptics.vibrate(80)
|
if (app.cores.haptics?.vibrate) {
|
||||||
|
app.cores.haptics.vibrate(80)
|
||||||
|
}
|
||||||
|
|
||||||
// remove the timeout
|
// remove the timeout
|
||||||
this._navTouchStart = null
|
this._navTouchStart = null
|
||||||
@ -283,7 +285,9 @@ export class BottomBar extends React.Component {
|
|||||||
if (item.location) {
|
if (item.location) {
|
||||||
app.setLocation(item.location)
|
app.setLocation(item.location)
|
||||||
|
|
||||||
app.cores.haptics.vibrate([40, 80])
|
if (app.cores.haptics?.vibrate) {
|
||||||
|
app.cores.haptics.vibrate([40, 80])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +321,9 @@ export class BottomBar extends React.Component {
|
|||||||
|
|
||||||
closest.classList.add("hover")
|
closest.classList.add("hover")
|
||||||
|
|
||||||
app.cores.haptics.vibrate(40)
|
if (app.cores.haptics?.vibrate) {
|
||||||
|
app.cores.haptics.vibrate(40)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@ export default class HapticsCore extends Core {
|
|||||||
|
|
||||||
public = {
|
public = {
|
||||||
isGlobalDisabled: HapticsCore.isGlobalDisabled,
|
isGlobalDisabled: HapticsCore.isGlobalDisabled,
|
||||||
vibration: this.vibration.bind(this),
|
vibrate: this.vibrate.bind(this),
|
||||||
}
|
}
|
||||||
|
|
||||||
vibration(...args) {
|
vibrate(...args) {
|
||||||
const disabled = this.isGlobalDisabled
|
const disabled = this.isGlobalDisabled
|
||||||
|
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user