@opexa/portal-components 0.0.978 → 0.0.979

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.
@@ -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
+ globalStore.kyc.setOpen(false);
39
+ globalStore.updateMobilePhoneNumber.setOpen(true);
40
+ }
41
+ else {
42
+ globalStore.updateMobilePhoneNumber.setOpen(false);
43
+ globalStore.kyc.setOpen(true);
44
+ }
45
+ hasExecuted.current = true;
43
46
  }
44
- }, [isAccountLoading, account?.mobileNumber]);
47
+ }, [
48
+ isAccountLoading,
49
+ account,
50
+ hasMobileNumber,
51
+ globalStore.kyc,
52
+ globalStore.updateMobilePhoneNumber,
53
+ ]);
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.979",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",