Make hidden backend selector only visible after 9 taps
This commit is contained in:
@@ -81,6 +81,13 @@ export class Login extends React.Component {
|
||||
apiModal: null,
|
||||
waitModal: null,
|
||||
}
|
||||
this.hiddenTouchCount = 0
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.hiddenTouchTimer) {
|
||||
clearTimeout(this.hiddenTouchTimer)
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
@@ -121,7 +128,23 @@ export class Login extends React.Component {
|
||||
|
||||
@autobind
|
||||
handleApiPress() {
|
||||
this.setState({ apiModal: {} })
|
||||
this.hiddenTouchCount += 1
|
||||
|
||||
if (this.hiddenTouchCount == 9) {
|
||||
this.hiddenTouchCount = 0
|
||||
this.setState({ apiModal: {} })
|
||||
return
|
||||
} else {
|
||||
if (this.hiddenTouchTimer) {
|
||||
clearTimeout(this.hiddenTouchTimer)
|
||||
this.hiddenTouchTimer = null
|
||||
}
|
||||
|
||||
this.hiddenTouchTimer = setTimeout(
|
||||
() => (this.hiddenTouchCount = 0),
|
||||
1000
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user