makerspace-react-rails 0.4.1 → 0.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 765466c17d543fb5979cff587dd50f482a05d6ae2e92b90c1f335e7d6fb4a718
4
- data.tar.gz: aeb22ee8117b52f9f76bbc4f2f594239cc9185638ef1a7e924a24f15d781bac3
3
+ metadata.gz: f56b54a1292e87640140ba2b3fd8c845fc78831760a115f259c50d353c955744
4
+ data.tar.gz: 3e79cdce97f0b4d2253620462a51ecbde08f44fa566347a815414cfb8da777e9
5
5
  SHA512:
6
- metadata.gz: 56334d61bccb263c5c37747ab002384de008b53b5c23be79b85f4d7c26b8cba0cb793d10d2dfc6f1427c90f537c1a447c76880b88460255ea5dbb057f4e461bb
7
- data.tar.gz: 80d0e3fd31db2a357463b6a3b219c0f2fdcca228f6ce88c2ac112fd7aecfebd8ab982d28d0c9796f1809fe178c5fe088e962d17949b60fe3f5a67f40c237fbec
6
+ metadata.gz: 376072eb99ebc9a432a733a8fb44a4b07f245147ae9e8c68bf668323620c6204e89cd0f569d81cf66d0810ef0dbb065830b0030151ee165deb5599d224295fb4
7
+ data.tar.gz: 13bced1a12dd04a7e83ae3948f901a4c998a39af12c630b536970304f9904646128f3ffaea42acdda7dcd9b0b62a39d74b317312f9456ff231c5ea5f786908a2
@@ -1,7 +1,7 @@
1
1
  module Makerspace
2
2
  module React
3
3
  module Rails
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
6
6
  end
7
7
  end
@@ -184713,23 +184713,27 @@ var MemberProfile = function () {
184713
184713
  history.push(constants_1.Routing.Settings.replace(constants_1.Routing.PathPlaceholder.MemberId, currentUserId));
184714
184714
  }, [currentUserId]);
184715
184715
  var _e = useReadTransaction_1.default(makerspace_ts_api_client_1.getMember, memberId), memberLoading = _e.isRequesting, refreshMember = _e.refresh, memberError = _e.error, _f = _e.data, member = _f === void 0 ? {} : _f;
184716
- var _g = React.useState(), notification = _g[0], setNotificaation = _g[1];
184717
- React.useEffect(function () {
184716
+ var _g = React.useState(), notification = _g[0], setNotification = _g[1];
184717
+ React.useLayoutEffect(function () {
184718
184718
  if (isOwnProfile && !memberLoading && member.hasOwnProperty("memberContractOnFile")) {
184719
184719
  if (member.memberContractOnFile) {
184720
- setNotificaation(undefined);
184720
+ setNotification(undefined);
184721
184721
  }
184722
184722
  else {
184723
- setNotificaation(NotificationModal_1.Notification.Welcome);
184723
+ setNotification(NotificationModal_1.Notification.Welcome);
184724
184724
  }
184725
184725
  }
184726
- }, [isOwnProfile, memberLoading, setNotificaation, member.memberContractOnFile]);
184726
+ }, [isOwnProfile, memberLoading, setNotification, member.memberContractOnFile]);
184727
+ // Don't render the notification box on the first paint
184728
+ // Helps prevent flickering issue
184729
+ var _h = React.useState(false), renderNotification = _h[0], setRenderNotification = _h[1];
184730
+ React.useEffect(function () { return setRenderNotification(true); }, []);
184727
184731
  var customerId = member.customerId, earnedMembershipId = member.earnedMembershipId;
184728
184732
  var isEarnedMember = !!earnedMembershipId && (isOwnProfile || isAdmin);
184729
184733
  var closeNotification = React.useCallback(function () {
184730
184734
  refreshMember();
184731
- setNotificaation(undefined);
184732
- }, [refreshMember, setNotificaation]);
184735
+ setNotification(undefined);
184736
+ }, [refreshMember, setNotification]);
184733
184737
  var goToAgreements = React.useCallback(function () {
184734
184738
  history.push(constants_1.Routing.Documents);
184735
184739
  }, [history]);
@@ -184773,7 +184777,7 @@ var MemberProfile = function () {
184773
184777
  displayName: "Payment History",
184774
184778
  content: (React.createElement(TransactionsList_1.default, { member: member }))
184775
184779
  }] : []) }),
184776
- React.createElement(NotificationModal_1.default, { notification: notification, onSubmit: goToAgreements, onClose: closeNotification })));
184780
+ renderNotification && React.createElement(NotificationModal_1.default, { notification: notification, onSubmit: goToAgreements, onClose: closeNotification })));
184777
184781
  };
184778
184782
  exports.default = MemberProfile;
184779
184783
 
@@ -185066,7 +185070,7 @@ var NotificationModal = /** @class */ (function (_super) {
185066
185070
  return null;
185067
185071
  }
185068
185072
  var closeHandler = displayedNotification.required ? undefined : onClose;
185069
- return (React.createElement(FormModal_1.default, { formRef: this.setFormRef, id: "notification-modal", isOpen: !!notification, title: displayedNotification.title, onSubmit: onSubmit, submitText: displayedNotification.submit, closeHandler: closeHandler },
185073
+ return (React.createElement(FormModal_1.default, { formRef: this.setFormRef, id: "notification-modal", isOpen: true, title: displayedNotification.title, onSubmit: onSubmit, submitText: displayedNotification.submit, closeHandler: closeHandler },
185070
185074
  React.createElement(Typography_1.default, { variant: "body1", style: { whiteSpace: "pre-line" } }, displayedNotification.body)));
185071
185075
  };
185072
185076
  return NotificationModal;