Skip to content

Commit e2e3e31

Browse files
committed
fix: Camera accesss denied flow in monitorer
1 parent b42acc4 commit e2e3e31

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/pods/components/intermediate-contest-view/component.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export default class IntermediateContestComponent extends Component {
4242
@computed('monitorerError')
4343
get monitorerErrorText() {
4444
switch(this.monitorerError) {
45-
case "CAMERAACCESSDENIED": return 'Please grant camera permissions to continue with test.'
45+
case "CAMERAACCESSDENIED": return 'Please grant camera and mic permissions to continue with test.'
46+
case "ACCESS_DENIED": return 'Please grant camera and mic permissions to continue with test.'
4647
}
4748
}
4849

@@ -104,7 +105,7 @@ export default class IntermediateContestComponent extends Component {
104105
}
105106

106107
@action promptCameraPermission() {
107-
navigator.mediaDevices.getUserMedia ({video: true},
108+
navigator.mediaDevices.getUserMedia ({video: true, mic: true},
108109
// successCallback
109110
function() {
110111
this.set('monitorerError', '')

app/pods/contests/contest/attempt/controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class AttemptController extends Controller{
3333
this.set('isMonitorerSet', false)
3434

3535
switch(detail.code) {
36-
case "CAMERAACCESSDENIED":
36+
case "ACCESS_DENIED":
3737
this.transitionToRoute('contests.contest', this.contest.id, {
3838
queryParams: {
3939
monitorerError: detail.code

app/services/monitorer.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ export default Service.extend({
7373
},
7474

7575
async disable() {
76-
this.set('contest', null)
77-
this.set('onError', null)
78-
76+
// this.set('contest', null)
77+
// this.set('onError', null)
7978
await this.disableTabSwitchMonitorer()
8079
await this.disableWindowResizeMonitorer()
8180
await this.disableNoFaceMonitorer()
81+
await this.disableMultipleFacesMonitorer()
8282

8383
window.removeEventListener('monitorerfault', this.monitorerFaultEventHandler)
8484
},

0 commit comments

Comments
 (0)