Skip to content

Commit

Permalink
fix(ui): clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonwellsjo committed Oct 16, 2023
1 parent cc83257 commit bc39a0a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/admin/adminService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,28 @@ export class AdminService {
this.touchSequenceIndex = 1
return
}
const touchSequence: ((clientX: number, clientY: number) => boolean)[] = [
this.lowerLeftCorner,
this.lowerRightCorner,
this.lowerLeftCorner,
this.lowerRightCorner,
this.lowerLeftCorner,
]

if (touchSequence[this.touchSequenceIndex]!(clientX, clientY)) {
if (this.touchSequence[this.touchSequenceIndex]!(clientX, clientY)) {
this.touchSequenceIndex++
} else {
this.touchSequenceIndex = 1
return
}

if (this.touchSequenceIndex === touchSequence.length) {
if (this.touchSequenceIndex === this.touchSequence.length) {
this.touchSequenceIndex = 1
await this.checkAllowToggle()
}
}

private touchSequence: ((clientX: number, clientY: number) => boolean)[] = [
this.lowerLeftCorner,
this.lowerRightCorner,
this.lowerLeftCorner,
this.lowerRightCorner,
this.lowerLeftCorner,
]

private lowerRightCorner(clientX: number, clientY: number): boolean {
const rightLowerCorner: [xAxis: number, yAxis: number] = [
window.innerWidth - 40,
Expand Down

0 comments on commit bc39a0a

Please sign in to comment.