@newtonschool/react_proctoring_library 0.0.89 → 0.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -79,19 +79,16 @@ function ElectronScreenShare(_ref) {
|
|
|
79
79
|
streamId: newStreamId
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
|
-
const isRecurring = config === null || config === void 0 ? void 0 : config.recurring;
|
|
83
82
|
const screenShareConfig = config === null || config === void 0 ? void 0 : (_config$fileUploadCon = config.fileUploadConfig) === null || _config$fileUploadCon === void 0 ? void 0 : _config$fileUploadCon.screenShare;
|
|
84
83
|
(0, _react.useEffect)(() => {
|
|
85
|
-
|
|
86
|
-
if (streamDeviceId && screenShareConfig && isRecurring) {
|
|
84
|
+
if (streamDeviceId && screenShareConfig) {
|
|
87
85
|
const snapshotIntervalID = startScreenShareSnapshot(streamDeviceId);
|
|
88
86
|
return () => {
|
|
89
87
|
endScreenShareSnapshot(snapshotIntervalID);
|
|
90
88
|
};
|
|
91
89
|
}
|
|
92
|
-
}, [streamDeviceId,
|
|
90
|
+
}, [streamDeviceId, screenShareConfig]);
|
|
93
91
|
(0, _react.useEffect)(() => {
|
|
94
|
-
console.log('streamDeviceId', streamDeviceId);
|
|
95
92
|
const permissionSetter = permission => {
|
|
96
93
|
setScreensharePermission(permission);
|
|
97
94
|
};
|
|
@@ -103,6 +100,5 @@ function ElectronScreenShare(_ref) {
|
|
|
103
100
|
window.electron.listener.removeListener(id, permissionSetter);
|
|
104
101
|
};
|
|
105
102
|
}, [streamDeviceId]);
|
|
106
|
-
console.log('streamDeviceId', isRecurring, screenShareConfig, streamDeviceId);
|
|
107
103
|
return null;
|
|
108
104
|
}
|
|
@@ -36,7 +36,7 @@ function WebScreenShare(_ref) {
|
|
|
36
36
|
streamSetter,
|
|
37
37
|
permissions
|
|
38
38
|
} = (0, _react.useContext)(proctoredContext);
|
|
39
|
-
const recurringFetchIntervalRef = (0, _react.useRef)();
|
|
39
|
+
const recurringFetchIntervalRef = (0, _react.useRef)(null);
|
|
40
40
|
const {
|
|
41
41
|
recurring = false,
|
|
42
42
|
recurringFetchInterval = 0
|
|
@@ -74,7 +74,9 @@ function WebScreenShare(_ref) {
|
|
|
74
74
|
}, randomStartDelay);
|
|
75
75
|
}
|
|
76
76
|
return () => {
|
|
77
|
-
|
|
77
|
+
if (recurringFetchIntervalRef.current) {
|
|
78
|
+
clearInterval(recurringFetchIntervalRef.current);
|
|
79
|
+
}
|
|
78
80
|
clearTimeout(timeoutId);
|
|
79
81
|
};
|
|
80
82
|
}, [recurring, recurringFetchInterval, sendScreengrab]);
|