authscape 1.0.494 → 1.0.496

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.
package/index.js CHANGED
@@ -3665,8 +3665,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import
3665
3665
  function AssignMapping(_ref) {
3666
3666
  var currentUser = _ref.currentUser,
3667
3667
  documentComponentId = _ref.documentComponentId,
3668
- _ref$onOpen = _ref.onOpen,
3669
- onOpen = _ref$onOpen === void 0 ? null : _ref$onOpen,
3670
3668
  _ref$onCancel = _ref.onCancel,
3671
3669
  onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel,
3672
3670
  _ref$onPublished = _ref.onPublished,
@@ -4430,6 +4428,13 @@ function FileMapping(_ref) {
4430
4428
  _useState2 = _slicedToArray(_useState, 2),
4431
4429
  documentComponentId = _useState2[0],
4432
4430
  setDocumentComponentId = _useState2[1];
4431
+ (0, _react.useEffect)(function () {
4432
+ if (documentComponentId != null) {
4433
+ if (onOpened != null) {
4434
+ onOpened(documentComponentId);
4435
+ }
4436
+ }
4437
+ }, [documentComponentId]);
4433
4438
  return /*#__PURE__*/_react["default"].createElement(_system.Box, null, documentComponentId == null && /*#__PURE__*/_react["default"].createElement(ManageMappingDocuments, {
4434
4439
  hideDocumentManager: hideDocumentManager,
4435
4440
  companyId: currentUser != null ? currentUser.companyId : null,
@@ -4445,11 +4450,6 @@ function FileMapping(_ref) {
4445
4450
  }), documentComponentId != null && /*#__PURE__*/_react["default"].createElement(AssignMapping, {
4446
4451
  currentUser: currentUser,
4447
4452
  documentComponentId: documentComponentId,
4448
- onOpen: function onOpen() {
4449
- if (onOpened != null) {
4450
- onOpened(documentComponentId);
4451
- }
4452
- },
4453
4453
  onCancel: function onCancel() {
4454
4454
  setDocumentComponentId(null);
4455
4455
  if (onCanceled != null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.494",
3
+ "version": "1.0.496",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,7 +15,7 @@ import CloseIcon from '@mui/icons-material/Close';
15
15
  import IconButton from '@mui/material/IconButton';
16
16
  import ArrowRightAltRoundedIcon from '@mui/icons-material/ArrowRightAltRounded';
17
17
 
18
- export function AssignMapping({currentUser, documentComponentId, onOpen = null, onCancel = null, onPublished = null}) {
18
+ export function AssignMapping({currentUser, documentComponentId, onCancel = null, onPublished = null}) {
19
19
 
20
20
  const [documentId, setDocumentId] = useState(documentComponentId);
21
21
 
@@ -6,7 +6,19 @@ import { Box } from '@mui/system';
6
6
  export function FileMapping({currentUser, hideDocumentManager, onOpened = null, onPublished = null, onCanceled = null, onArchived = null}) {
7
7
 
8
8
  const [documentComponentId, setDocumentComponentId] = useState(null);
9
-
9
+
10
+ useEffect(() => {
11
+
12
+ if (documentComponentId != null)
13
+ {
14
+ if (onOpened != null)
15
+ {
16
+ onOpened(documentComponentId);
17
+ }
18
+ }
19
+
20
+ }, [documentComponentId]);
21
+
10
22
  return (
11
23
  <Box>
12
24
  {documentComponentId == null &&
@@ -32,12 +44,6 @@ export function FileMapping({currentUser, hideDocumentManager, onOpened = null,
32
44
 
33
45
  {documentComponentId != null &&
34
46
  <AssignMapping currentUser={currentUser} documentComponentId={documentComponentId}
35
- onOpen={() => {
36
- if (onOpened != null)
37
- {
38
- onOpened(documentComponentId);
39
- }
40
- }}
41
47
  onCancel={() => {
42
48
 
43
49
  setDocumentComponentId(null);