@opexa/portal-components 0.0.343 → 0.0.345
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.
|
@@ -10,7 +10,7 @@ import { XIcon } from '../../icons/XIcon.js';
|
|
|
10
10
|
import { Dialog } from '../../ui/Dialog/index.js';
|
|
11
11
|
import { Portal } from '../../ui/Portal/index.js';
|
|
12
12
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
13
|
-
import { getMemberVerificationQueryKey } from '../../utils/queryKeys.js';
|
|
13
|
+
import { getAccountQueryKey, getMemberVerificationQueryKey, getProfileCompletionQueryKey, } from '../../utils/queryKeys.js';
|
|
14
14
|
import { KYCReminder } from './KYCReminder.js';
|
|
15
15
|
export function KYCSumsub(props) {
|
|
16
16
|
const [open, setOpen] = useGlobalStore(useShallow((ctx) => [ctx.kyc.open, ctx.kyc.setOpen]));
|
|
@@ -109,6 +109,7 @@ export function KYCSumsub(props) {
|
|
|
109
109
|
type,
|
|
110
110
|
payload,
|
|
111
111
|
});
|
|
112
|
+
const queryClient = getQueryClient();
|
|
112
113
|
if (type === 'idCheck.onApplicantStatusChanged' &&
|
|
113
114
|
isObject(payload) &&
|
|
114
115
|
'reviewStatus' in payload &&
|
|
@@ -117,7 +118,7 @@ export function KYCSumsub(props) {
|
|
|
117
118
|
isObject(payload.reviewResult) &&
|
|
118
119
|
'reviewAnswer' in payload.reviewResult &&
|
|
119
120
|
payload.reviewResult.reviewAnswer === 'GREEN') {
|
|
120
|
-
|
|
121
|
+
queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => ({
|
|
121
122
|
id: '',
|
|
122
123
|
address: '',
|
|
123
124
|
nationality: '',
|
|
@@ -130,6 +131,22 @@ export function KYCSumsub(props) {
|
|
|
130
131
|
...(prev ?? {}),
|
|
131
132
|
status: 'APPROVED',
|
|
132
133
|
}));
|
|
134
|
+
queryClient.setQueryData(getAccountQueryKey(), (prev) => {
|
|
135
|
+
if (!prev)
|
|
136
|
+
return prev;
|
|
137
|
+
return {
|
|
138
|
+
...prev,
|
|
139
|
+
verified: true,
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
queryClient.setQueryData(getProfileCompletionQueryKey(), (prev) => {
|
|
143
|
+
if (!prev)
|
|
144
|
+
return prev;
|
|
145
|
+
return {
|
|
146
|
+
...prev,
|
|
147
|
+
accountVerification: true,
|
|
148
|
+
};
|
|
149
|
+
});
|
|
133
150
|
}
|
|
134
151
|
}, onError: (error) => {
|
|
135
152
|
console.warn(error);
|