Skip to content

Commit

Permalink
logs for monitorer debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
vdvibhu20 committed Apr 18, 2024
1 parent 836ae3c commit 4245e2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/services/monitorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ export default Service.extend({

if('webkitHidden' in document) {
document.addEventListener("webkitvisibilitychange", this.tabSwitchEventHandler);
console.log('webkitvisibilitychange event added')
} else {
document.addEventListener("visibilitychange", this.tabSwitchEventHandler);
console.log('visibilitychange event added')
}
},

Expand All @@ -111,6 +113,7 @@ export default Service.extend({
},

async tabSwitchEventHandler() {
console.log('tabSwitchEventHandler', document.hidden, document.webkitHidden)
if(!document.hidden) return this.set('tabSwitchTrigger', true)

const currentAttempt = await this.router.get('currentRoute.attributes.contest.currentAttempt')
Expand Down

0 comments on commit 4245e2d

Please sign in to comment.