@influenzanet/case-web-app-core 2.8.7-staging → 2.8.8-staging

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/build/index.es.js CHANGED
@@ -22625,6 +22625,13 @@ var VerifyWhatsApp = function () {
22625
22625
  var _d = useState(''), error = _d[0], setError = _d[1];
22626
22626
  var _e = useState(''), verificationCode = _e[0], setVerificationCode = _e[1];
22627
22627
  var phoneNumber = (dialogContent === null || dialogContent === void 0 ? void 0 : dialogContent.phoneNumber) || '';
22628
+ // Reset verification code when dialog opens
22629
+ useEffect(function () {
22630
+ if (open) {
22631
+ setVerificationCode('');
22632
+ setError('');
22633
+ }
22634
+ }, [open]);
22628
22635
  var close = function () {
22629
22636
  dispatch(dialogActions.closeDialog());
22630
22637
  setVerificationCode('');
@@ -24053,12 +24060,25 @@ var AccountSettings = function (props) {
24053
24060
  var isAuth = useIsAuthenticated();
24054
24061
  var dispatch = useDispatch();
24055
24062
  var currentUser = useSelector(function (state) { return state.user.currentUser; });
24063
+ var dialogState = useSelector(function (state) { return state.dialog; });
24056
24064
  var _a = useState(false), isResending = _a[0], setIsResending = _a[1];
24057
24065
  var _b = useState(null), resendMessage = _b[0], setResendMessage = _b[1];
24066
+ var phoneInfo = currentUser === null || currentUser === void 0 ? void 0 : currentUser.contactInfos.find(function (info) { return info.type === 'phone'; });
24067
+ // Clear success message when phone is verified
24068
+ useEffect(function () {
24069
+ if (phoneInfo && phoneInfo.confirmedAt && phoneInfo.confirmedAt > 0) {
24070
+ setResendMessage(null);
24071
+ }
24072
+ }, [phoneInfo]);
24073
+ // Clear success message when dialog closes
24074
+ useEffect(function () {
24075
+ if (dialogState.config === undefined && (resendMessage === null || resendMessage === void 0 ? void 0 : resendMessage.type) === 'success') {
24076
+ setResendMessage(null);
24077
+ }
24078
+ }, [dialogState.config, resendMessage === null || resendMessage === void 0 ? void 0 : resendMessage.type]);
24058
24079
  if (!isAuth) {
24059
24080
  return jsx("div", __assign({ className: "bg-warning-light p-3" }, { children: 'authentication needed' }), void 0);
24060
24081
  }
24061
- var phoneInfo = currentUser.contactInfos.find(function (info) { return info.type === 'phone'; });
24062
24082
  console.log('phoneInfo:', phoneInfo);
24063
24083
  console.log('confirmedAt:', phoneInfo === null || phoneInfo === void 0 ? void 0 : phoneInfo.confirmedAt);
24064
24084
  var handleResendCode = function () { return __awaiter(void 0, void 0, void 0, function () {