Skip to content

Commit

Permalink
fix: tabSwitchTrigger true when document is visible
Browse files Browse the repository at this point in the history
  • Loading branch information
vdvibhu20 committed Mar 9, 2024
1 parent f0f7959 commit 688b6e5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/services/monitorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@ export default Service.extend({
},

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

const currentAttempt = await this.router.get('currentRoute.attributes.contest.currentAttempt')
await this.api.request(`/contest-attempts/${currentAttempt.id}/report-monitorer-fault`, {
method: 'POST',
data: {
fault_type: 'tab_switch'
}
})
this.set('tabSwitchTrigger', true)
})
await this.store.findRecord('contest-attempt', currentAttempt.id)
},

Expand Down

0 comments on commit 688b6e5

Please sign in to comment.