@opexa/portal-components 0.0.978 → 0.0.980

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.
@@ -25,7 +25,8 @@ export function KYCDefault(props) {
25
25
  const isDialogOpen = globalStore.kyc.open &&
26
26
  !globalStore.kycReminder.open &&
27
27
  !sessionLoading &&
28
- !globalStore.disclaimer.open;
28
+ !globalStore.disclaimer.open &&
29
+ !globalStore.updateMobilePhoneNumber.open;
29
30
  return (_jsxs(_Fragment, { children: [_jsx(KYCDefaultContext, { value: kyc, children: _jsx(Dialog.Root, { open: isDialogOpen, onOpenChange: (details) => {
30
31
  globalStore.kyc.setOpen(details.open);
31
32
  }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "fixed top-[57px] overflow-hidden", children: _jsx(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto bg-bg-primary-alt md:max-h-[95vh] lg:w-fit", children: _jsxs("div", { className: "mt-[calc(var(--safe-area-inset-top)*3)] flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit lg:w-[400px]", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(IdentityVerification, {}), kyc.step === 2 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props }), _jsx(KYCReview, {})] }));
@@ -31,17 +31,26 @@ export function UpdateMobilePhoneNumber() {
31
31
  const account = accountQuery.data;
32
32
  const isAccountLoading = accountQuery.isLoading;
33
33
  const hasMobileNumber = !!account?.mobileNumber;
34
- // biome-ignore lint/correctness/useExhaustiveDependencies: We only want to open the dialog when the account data loads, not on every hasMobileNumber change
34
+ const hasExecuted = useRef(false);
35
35
  useEffect(() => {
36
- if (!isAccountLoading && !!account && !hasMobileNumber) {
37
- globalStore.kyc.setOpen(false);
38
- globalStore.updateMobilePhoneNumber.setOpen(true);
39
- }
40
- else if (!isAccountLoading && !!account && hasMobileNumber) {
41
- globalStore.updateMobilePhoneNumber.setOpen(false);
42
- globalStore.kyc.setOpen(true);
36
+ if (!isAccountLoading && !!account && !hasExecuted.current) {
37
+ if (!hasMobileNumber) {
38
+ console.log('No mobile number found');
39
+ globalStore.updateMobilePhoneNumber.setOpen(true);
40
+ }
41
+ else {
42
+ console.log('Mobile number found');
43
+ globalStore.updateMobilePhoneNumber.setOpen(false);
44
+ }
45
+ hasExecuted.current = true;
43
46
  }
44
- }, [isAccountLoading, account?.mobileNumber]);
47
+ }, [
48
+ isAccountLoading,
49
+ account,
50
+ hasMobileNumber,
51
+ globalStore.updateMobilePhoneNumber,
52
+ ]);
53
+ console.log('UpdateMobilePhoneNumber open:', globalStore.updateMobilePhoneNumber.open);
45
54
  const [step, setStep] = useState(1);
46
55
  const sendVerificationCodeMutation = useSendVerificationCodeMutation({
47
56
  onSuccess: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.978",
3
+ "version": "0.0.980",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",