@newtonschool/react_proctoring_library 0.0.119 → 0.0.120

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.
@@ -44,7 +44,8 @@ const ProctorApp = _ref => {
44
44
  getProctorParamValues = () => {},
45
45
  getWebcamSnapshot = () => {},
46
46
  getScreengrab = () => {},
47
- logger = () => {}
47
+ logger = () => {},
48
+ onProctoredViewChange = () => {}
48
49
  } = _ref;
49
50
  const context = (0, _react.useContext)(proctoredContext);
50
51
  const isElectronApp = (0, _react.useContext)(_ElectronContext.ElectronContext);
@@ -73,7 +74,7 @@ const ProctorApp = _ref => {
73
74
  }, []);
74
75
  const CustomPermissionView = customPermissionView;
75
76
  const proctorParams = (0, _react.useMemo)(() => _objectSpread(_objectSpread({}, _defaults.defaultConfig), config.proctorParams), [config.proctorParams]);
76
- const shouldShowProctoredComponent = (0, _breachUtils.showProctoredComponent)(proctorParams, permissions);
77
+ const shouldShowProctoredComponent = (0, _react.useMemo)(() => (0, _breachUtils.showProctoredComponent)(proctorParams, permissions), [proctorParams, permissions, _breachUtils.showProctoredComponent]);
77
78
  const allPermissionsGrantedCallback = () => {
78
79
  if (!calledAllPermissionHandler.current) {
79
80
  var _window$electron$acti, _window$electron$acti2;
@@ -104,6 +105,9 @@ const ProctorApp = _ref => {
104
105
  allPermissionGrantedOnce.current = true;
105
106
  }
106
107
  }, [allPermissionGrantedOnce, permissions, proctorParams]);
108
+ (0, _react.useEffect)(() => {
109
+ onProctoredViewChange(shouldShowProctoredComponent);
110
+ }, [shouldShowProctoredComponent]);
107
111
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
108
112
  className: "".concat(proctorParams.copyPasteProctoring ? 'disable-copy-paste fullwidth fullheight' : 'fullwidth fullheight'),
109
113
  children: [shouldShowProctoredComponent && children, !shouldShowProctoredComponent && customPermissionView && /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomPermissionView, _objectSpread({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtonschool/react_proctoring_library",
3
- "version": "0.0.119",
3
+ "version": "0.0.120",
4
4
  "description": "Used to proctor online tests",
5
5
  "author": "ayushkagrawal,shreyachandra,weastel",
6
6
  "main": "dist/index.js",