@opexa/portal-components 0.0.438 → 0.0.439
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/dist/client/hooks/useAccountQuery.js +6 -2
- package/dist/client/hooks/useApproveMemberVerification.d.ts +1 -3
- package/dist/client/hooks/useApproveMemberVerification.js +3 -6
- package/dist/client/hooks/useAvailablePromosQuery.js +6 -2
- package/dist/client/hooks/useAvailableQuestsCountQuery.js +6 -2
- package/dist/client/hooks/useAvailableQuestsQuery.js +5 -2
- package/dist/client/hooks/useBetRecordsQuery.js +6 -2
- package/dist/client/hooks/useBonusQuery.js +6 -2
- package/dist/client/hooks/useBonusesCountQuery.js +6 -2
- package/dist/client/hooks/useBonusesQuery.js +5 -2
- package/dist/client/hooks/useCashbackBonusQuery.js +6 -2
- package/dist/client/hooks/useCashbackBonusesCountQuery.js +6 -2
- package/dist/client/hooks/useCashbackBonusesQuery.js +5 -2
- package/dist/client/hooks/useControllableState.d.ts +8 -5
- package/dist/client/hooks/useControllableState.js +6 -27
- package/dist/client/hooks/useDepositQuery.js +6 -2
- package/dist/client/hooks/useDepositRecordsQuery.js +6 -2
- package/dist/client/hooks/useDepositsCountQuery.js +6 -2
- package/dist/client/hooks/useFavoriteGamesQuery.js +6 -2
- package/dist/client/hooks/useFileQuery.js +6 -2
- package/dist/client/hooks/useInstapayBankListQuery.js +6 -2
- package/dist/client/hooks/useIsMayaSessionValidQuery.js +6 -2
- package/dist/client/hooks/useMemberVerificationQuery.js +6 -2
- package/dist/client/hooks/useMessagesQuery.js +6 -2
- package/dist/client/hooks/useOnboardingStatusQuery.js +6 -2
- package/dist/client/hooks/usePaymentSettingsQuery.js +6 -2
- package/dist/client/hooks/useProfileCompletionQuery.js +6 -2
- package/dist/client/hooks/useRecommendedGamesQuery.js +6 -2
- package/dist/client/hooks/useSessionHealthQuery.js +6 -2
- package/dist/client/hooks/useTransactionRecordsQuery.js +6 -2
- package/dist/client/hooks/useUnreadMessagesCountQuery.js +6 -2
- package/dist/client/hooks/useWalletQuery.js +6 -2
- package/dist/client/hooks/useWithdrawalRecordsQuery.js +6 -2
- package/dist/components/Banner/Banner.client.d.ts +12 -0
- package/dist/components/Banner/Banner.client.js +49 -0
- package/dist/components/DigitainLauncher/Loading.js +1 -1
- package/dist/components/FavoriteGames/FavoriteGames.client.js +11 -1
- package/dist/components/GameLaunch/GameLaunchTrigger.js +10 -3
- package/dist/components/Games/Game.js +11 -1
- package/dist/components/Jackpots/Jackpots.module.css +184 -184
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/KYC/BasicInformation.js +1 -1
- package/dist/components/KYC/IdentityVerification.js +1 -1
- package/dist/components/KYC/KYC.lazy.js +1 -1
- package/dist/components/KYC/KYCDefault/PersonalInformation.js +1 -4
- package/dist/components/KYC/PersonalInformation.js +1 -1
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/constants/EnvVar.d.ts +1 -1
- package/dist/services/queries.js +2687 -2687
- package/dist/styles/theme.css +719 -719
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +99 -99
- package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +90 -90
- package/dist/ui/Menu/menu.recipe.d.ts +5 -5
- package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
- package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PinInput/PinInput.d.ts +12 -12
- package/dist/ui/PinInput/pinInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +55 -55
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/utils/getQueryClient.js +2 -1
- package/package.json +162 -161
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +0 -10
- package/dist/components/Disclaimer/ResponsibleGaming.js +0 -13
- package/dist/components/Disclaimer/TermsOfUse.d.ts +0 -11
- package/dist/components/Disclaimer/TermsOfUse.js +0 -13
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
- package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
- package/dist/components/FeatureFlag/index.d.ts +0 -1
- package/dist/components/FeatureFlag/index.js +0 -1
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -40
- package/dist/components/KYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/KYC/CaptureIdDocument.js +0 -219
- package/dist/components/KYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/KYC/CaptureSelfie.js +0 -285
- package/dist/components/KYC/DisplayImage.d.ts +0 -5
- package/dist/components/KYC/DisplayImage.js +0 -8
- package/dist/components/KYC/FileUpload.d.ts +0 -10
- package/dist/components/KYC/FileUpload.js +0 -72
- package/dist/components/KYC/NoCameraError.d.ts +0 -7
- package/dist/components/KYC/NoCameraError.js +0 -6
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/KYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/KYC/utils.d.ts +0 -9
- package/dist/components/KYC/utils.js +0 -79
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -35
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -20
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/Quests/CountdownTimer.d.ts +0 -15
- package/dist/components/Quests/CountdownTimer.js +0 -33
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
- package/dist/components/SignUp/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +0 -17
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +0 -310
- package/dist/components/SignUp/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpForm.js +0 -284
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +0 -42
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +0 -464
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +0 -20
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +0 -9
- package/dist/components/SignUp/SignUpKYC/utils.js +0 -79
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +0 -13
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
- package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
- package/dist/components/shared/IdDocumentField.client.js +0 -204
- package/dist/components/shared/IdDocumentField.d.ts +0 -2
- package/dist/components/shared/IdDocumentField.js +0 -11
- package/dist/components/shared/SelfieField.client.d.ts +0 -20
- package/dist/components/shared/SelfieField.client.js +0 -327
- package/dist/components/shared/SelfieField.d.ts +0 -2
- package/dist/components/shared/SelfieField.js +0 -11
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/handlers/postTransformIdFrontImage.d.ts +0 -3
- package/dist/handlers/postTransformIdFrontImage.js +0 -67
- package/dist/handlers/postTransformSelfieImage.d.ts +0 -3
- package/dist/handlers/postTransformSelfieImage.js +0 -71
- package/dist/handlers.d.ts +0 -43
- package/dist/handlers.js +0 -297
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +0 -1
- package/dist/utils/gamesAvailable3pmTo3am.js +0 -1
- package/dist/utils/getGameName.d.ts +0 -1
- package/dist/utils/getGameName.js +0 -6
- package/dist/utils/isBetween3amAnd3pm.d.ts +0 -1
- package/dist/utils/isBetween3amAnd3pm.js +0 -5
- package/dist/utils/resizeImageSize.d.ts +0 -2
- package/dist/utils/resizeImageSize.js +0 -11
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getMemberAccount } from '../../services/account.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getAccountQueryKey, getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useAccountQuery = (config) => {
|
|
@@ -13,7 +14,10 @@ export const useAccountQuery = (config) => {
|
|
|
13
14
|
: sessionQuery.data?.status === 'authenticated',
|
|
14
15
|
queryKey: getAccountQueryKey(),
|
|
15
16
|
queryFn: async ({ signal }) => {
|
|
16
|
-
const session = await
|
|
17
|
+
const session = await getQueryClient().fetchQuery({
|
|
18
|
+
queryKey: getSessionQueryKey(),
|
|
19
|
+
queryFn: async () => getSession(),
|
|
20
|
+
});
|
|
17
21
|
invariant(session.status === 'authenticated');
|
|
18
22
|
return await getMemberAccount({
|
|
19
23
|
signal,
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import type { SetOptional } from 'type-fest';
|
|
2
|
-
import { type ApproveMemberVerificationInput } from '../../services/account';
|
|
3
1
|
import type { Mutation } from '../../types';
|
|
4
|
-
export declare const useApproveMemberVerification: Mutation<
|
|
2
|
+
export declare const useApproveMemberVerification: Mutation<void, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
|
-
import { approveMemberVerification__next
|
|
3
|
+
import { approveMemberVerification__next } from '../../services/account.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
5
|
import { getApproveMemberVerificationQueryKey } from '../../utils/mutationKeys.js';
|
|
6
6
|
import { getAccountQueryKey } from '../../utils/queryKeys.js';
|
|
@@ -9,13 +9,11 @@ export const useApproveMemberVerification = (config) => {
|
|
|
9
9
|
const mutation = useMutation({
|
|
10
10
|
...config,
|
|
11
11
|
mutationKey: getApproveMemberVerificationQueryKey(),
|
|
12
|
-
mutationFn: async (
|
|
12
|
+
mutationFn: async (id) => {
|
|
13
13
|
const session = await getSession();
|
|
14
14
|
const queryClient = getQueryClient();
|
|
15
15
|
invariant(session.status === 'authenticated');
|
|
16
|
-
await approveMemberVerification__next({
|
|
17
|
-
id: data.id || '',
|
|
18
|
-
}, { headers: { Authorization: `Bearer ${session.token}` } });
|
|
16
|
+
await approveMemberVerification__next({ id }, { headers: { Authorization: `Bearer ${session.token}` } });
|
|
19
17
|
queryClient.setQueryData(getAccountQueryKey(), (prev) => {
|
|
20
18
|
if (!prev)
|
|
21
19
|
return prev;
|
|
@@ -24,7 +22,6 @@ export const useApproveMemberVerification = (config) => {
|
|
|
24
22
|
verificationStatus: 'PENDING',
|
|
25
23
|
};
|
|
26
24
|
});
|
|
27
|
-
return data.id || '';
|
|
28
25
|
},
|
|
29
26
|
});
|
|
30
27
|
return mutation;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getAvailablePromos, } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getAvailablePromosQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useAvailablePromosQuery = (input, config) => {
|
|
@@ -13,7 +14,10 @@ export const useAvailablePromosQuery = (input, config) => {
|
|
|
13
14
|
: sessionQuery.data?.status === 'authenticated',
|
|
14
15
|
queryKey: getAvailablePromosQueryKey(input),
|
|
15
16
|
queryFn: async ({ signal }) => {
|
|
16
|
-
const session = await
|
|
17
|
+
const session = await getQueryClient().fetchQuery({
|
|
18
|
+
queryKey: getSessionQueryKey(),
|
|
19
|
+
queryFn: async () => getSession(),
|
|
20
|
+
});
|
|
17
21
|
invariant(session.status === 'authenticated');
|
|
18
22
|
return await getAvailablePromos(input, {
|
|
19
23
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getAvailableQuestsCount } from '../../services/trigger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getAvailableQuestsCountQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useAvailableQuestsCountQuery = (config) => {
|
|
@@ -13,7 +14,10 @@ export const useAvailableQuestsCountQuery = (config) => {
|
|
|
13
14
|
: sessionQuery.data?.status === 'authenticated',
|
|
14
15
|
queryKey: getAvailableQuestsCountQueryKey(),
|
|
15
16
|
queryFn: async ({ signal }) => {
|
|
16
|
-
const session = await
|
|
17
|
+
const session = await getQueryClient().fetchQuery({
|
|
18
|
+
queryKey: getSessionQueryKey(),
|
|
19
|
+
queryFn: async () => getSession(),
|
|
20
|
+
});
|
|
17
21
|
invariant(session.status === 'authenticated');
|
|
18
22
|
return await getAvailableQuestsCount({
|
|
19
23
|
signal,
|
|
@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getAvailableQuests } from '../../services/trigger.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import { getAvailableQuestsCountQueryKey, getAvailableQuestsQueryKey, } from '../../utils/queryKeys.js';
|
|
5
|
+
import { getAvailableQuestsCountQueryKey, getAvailableQuestsQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
6
6
|
import { getSession } from '../services/getSession.js';
|
|
7
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
8
8
|
export const useAvailableQuestsQuery = (config) => {
|
|
@@ -15,7 +15,10 @@ export const useAvailableQuestsQuery = (config) => {
|
|
|
15
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
16
16
|
queryKey: getAvailableQuestsQueryKey(),
|
|
17
17
|
queryFn: async ({ signal }) => {
|
|
18
|
-
const session = await
|
|
18
|
+
const session = await queryClient.fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
19
22
|
invariant(session.status === 'authenticated');
|
|
20
23
|
const quests = await getAvailableQuests({
|
|
21
24
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getBetRecords } from '../../services/report.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getBetRecordsQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useBetRecordsQuery = (input, config) => {
|
|
@@ -14,7 +15,10 @@ export const useBetRecordsQuery = (input, config) => {
|
|
|
14
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
15
16
|
queryKey: getBetRecordsQueryKey(input),
|
|
16
17
|
queryFn: async ({ pageParam, signal }) => {
|
|
17
|
-
const session = await
|
|
18
|
+
const session = await getQueryClient().fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
18
22
|
invariant(session.status === 'authenticated');
|
|
19
23
|
return await getBetRecords({ ...input, after: pageParam }, {
|
|
20
24
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getBonus } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getBonusQueryKey, getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useBonusQuery = (id, config) => {
|
|
@@ -14,7 +15,10 @@ export const useBonusQuery = (id, config) => {
|
|
|
14
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
15
16
|
queryKey: getBonusQueryKey(id),
|
|
16
17
|
queryFn: async ({ signal }) => {
|
|
17
|
-
const session = await
|
|
18
|
+
const session = await getQueryClient().fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
18
22
|
invariant(session.status === 'authenticated');
|
|
19
23
|
const bonus = await getBonus(id, {
|
|
20
24
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getBonusesCount } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getBonusesCountQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useBonusesCountQuery = (config) => {
|
|
@@ -14,7 +15,10 @@ export const useBonusesCountQuery = (config) => {
|
|
|
14
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
15
16
|
queryKey: getBonusesCountQueryKey(),
|
|
16
17
|
queryFn: async ({ signal }) => {
|
|
17
|
-
const session = await
|
|
18
|
+
const session = await getQueryClient().fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
18
22
|
invariant(session.status === 'authenticated');
|
|
19
23
|
return await getBonusesCount({
|
|
20
24
|
signal,
|
|
@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getBonuses } from '../../services/wallet.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import { getBonusesCountQueryKey, getBonusesQueryKey, } from '../../utils/queryKeys.js';
|
|
5
|
+
import { getBonusesCountQueryKey, getBonusesQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
6
6
|
import { getSession } from '../services/getSession.js';
|
|
7
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
8
8
|
export const useBonusesQuery = (input, config) => {
|
|
@@ -16,7 +16,10 @@ export const useBonusesQuery = (input, config) => {
|
|
|
16
16
|
: sessionQuery.data?.status === 'authenticated',
|
|
17
17
|
queryKey: getBonusesQueryKey(input),
|
|
18
18
|
queryFn: async ({ signal }) => {
|
|
19
|
-
const session = await
|
|
19
|
+
const session = await queryClient.fetchQuery({
|
|
20
|
+
queryKey: getSessionQueryKey(),
|
|
21
|
+
queryFn: async () => getSession(),
|
|
22
|
+
});
|
|
20
23
|
invariant(session.status === 'authenticated');
|
|
21
24
|
const bonuses = await getBonuses(input, {
|
|
22
25
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getCashbackBonus } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getCashbackBonusQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useCashbackBonusQuery = (id, config) => {
|
|
@@ -14,7 +15,10 @@ export const useCashbackBonusQuery = (id, config) => {
|
|
|
14
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
15
16
|
queryKey: getCashbackBonusQueryKey(id),
|
|
16
17
|
queryFn: async ({ signal }) => {
|
|
17
|
-
const session = await
|
|
18
|
+
const session = await getQueryClient().fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
18
22
|
invariant(session.status === 'authenticated');
|
|
19
23
|
return await getCashbackBonus(id, {
|
|
20
24
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getCashbackBonusesCount } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getCashbackBonusesCountQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useCashbackBonusesCountQuery = (config) => {
|
|
@@ -14,7 +15,10 @@ export const useCashbackBonusesCountQuery = (config) => {
|
|
|
14
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
15
16
|
queryKey: getCashbackBonusesCountQueryKey(),
|
|
16
17
|
queryFn: async ({ signal }) => {
|
|
17
|
-
const session = await
|
|
18
|
+
const session = await getQueryClient().fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
18
22
|
invariant(session.status === 'authenticated');
|
|
19
23
|
return await getCashbackBonusesCount({
|
|
20
24
|
signal,
|
|
@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getCashbackBonuses } from '../../services/wallet.js';
|
|
4
4
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
-
import { getCashbackBonusesCountQueryKey, getCashbackBonusesQueryKey, } from '../../utils/queryKeys.js';
|
|
5
|
+
import { getCashbackBonusesCountQueryKey, getCashbackBonusesQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
6
6
|
import { getSession } from '../services/getSession.js';
|
|
7
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
8
8
|
export const useCashbackBonusesQuery = (config) => {
|
|
@@ -16,7 +16,10 @@ export const useCashbackBonusesQuery = (config) => {
|
|
|
16
16
|
: sessionQuery.data?.status === 'authenticated',
|
|
17
17
|
queryKey: getCashbackBonusesQueryKey(),
|
|
18
18
|
queryFn: async ({ signal }) => {
|
|
19
|
-
const session = await
|
|
19
|
+
const session = await queryClient.fetchQuery({
|
|
20
|
+
queryKey: getSessionQueryKey(),
|
|
21
|
+
queryFn: async () => getSession(),
|
|
22
|
+
});
|
|
20
23
|
invariant(session.status === 'authenticated');
|
|
21
24
|
const cashbackBonuses = await getCashbackBonuses({
|
|
22
25
|
signal,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface UseControllableStateProps<T> {
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export interface UseControllableStateProps<T> {
|
|
3
3
|
value?: T;
|
|
4
4
|
onChange?: (value: T) => void;
|
|
5
|
-
defaultValue
|
|
5
|
+
defaultValue: T;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
|
|
7
|
+
export type UseControllableStateReturn<T> = [
|
|
8
|
+
T,
|
|
9
|
+
React.Dispatch<React.SetStateAction<T>>
|
|
10
|
+
];
|
|
11
|
+
export declare function useControllableState<T>(props: UseControllableStateProps<T>): UseControllableStateReturn<T>;
|
|
@@ -1,30 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
function useCallbackRef(callback, deps = []) {
|
|
3
|
-
const callbackRef = React.useRef(() => {
|
|
4
|
-
throw new Error('Cannot call an event handler while rendering.');
|
|
5
|
-
});
|
|
6
|
-
React.useInsertionEffect(() => {
|
|
7
|
-
callbackRef.current = callback;
|
|
8
|
-
});
|
|
9
|
-
return React.useCallback((...args) => callbackRef.current?.(...args),
|
|
10
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: ""
|
|
11
|
-
deps);
|
|
12
|
-
}
|
|
1
|
+
import { useControllableState as usePrimitive } from '@radix-ui/react-use-controllable-state';
|
|
13
2
|
export function useControllableState(props) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const value = controlled ? userDefinedValue : uncontrolledState;
|
|
20
|
-
const setValue = useCallbackRef((next) => {
|
|
21
|
-
const setter = next;
|
|
22
|
-
const nextValue = typeof next === 'function' ? setter(value) : next;
|
|
23
|
-
if (!shouldUpdateProp(value, nextValue))
|
|
24
|
-
return;
|
|
25
|
-
if (!controlled)
|
|
26
|
-
setUncontrolledState(nextValue);
|
|
27
|
-
onChangeProp(nextValue);
|
|
28
|
-
}, [controlled, onChangeProp, value, shouldUpdateProp]);
|
|
3
|
+
const [value, setValue] = usePrimitive({
|
|
4
|
+
prop: props.value,
|
|
5
|
+
onChange: props.onChange,
|
|
6
|
+
defaultProp: props.defaultValue,
|
|
7
|
+
});
|
|
29
8
|
return [value, setValue];
|
|
30
9
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getDeposit } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getDepositQueryKey, getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useDepositQuery = (id, config) => {
|
|
@@ -15,7 +16,10 @@ export const useDepositQuery = (id, config) => {
|
|
|
15
16
|
: sessionQuery.data?.status === 'authenticated',
|
|
16
17
|
queryKey: getDepositQueryKey(id),
|
|
17
18
|
queryFn: async ({ signal }) => {
|
|
18
|
-
const session = await
|
|
19
|
+
const session = await getQueryClient().fetchQuery({
|
|
20
|
+
queryKey: getSessionQueryKey(),
|
|
21
|
+
queryFn: async () => getSession(),
|
|
22
|
+
});
|
|
19
23
|
invariant(session.status === 'authenticated');
|
|
20
24
|
const deposit = await getDeposit(id, {
|
|
21
25
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getDepositRecords, } from '../../services/report.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getDepositRecordsQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useDepositRecordsQuery = (input, config) => {
|
|
@@ -14,7 +15,10 @@ export const useDepositRecordsQuery = (input, config) => {
|
|
|
14
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
15
16
|
queryKey: getDepositRecordsQueryKey(input),
|
|
16
17
|
queryFn: async ({ pageParam, signal }) => {
|
|
17
|
-
const session = await
|
|
18
|
+
const session = await getQueryClient().fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
18
22
|
invariant(session.status === 'authenticated');
|
|
19
23
|
return await getDepositRecords({ ...input, after: pageParam }, {
|
|
20
24
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getDepositsCount } from '../../services/report.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getDepositsCountQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useDepositsCountQuery = (config) => {
|
|
@@ -13,7 +14,10 @@ export const useDepositsCountQuery = (config) => {
|
|
|
13
14
|
: sessionQuery.data?.status === 'authenticated',
|
|
14
15
|
queryKey: getDepositsCountQueryKey(),
|
|
15
16
|
queryFn: async ({ signal }) => {
|
|
16
|
-
const session = await
|
|
17
|
+
const session = await getQueryClient().fetchQuery({
|
|
18
|
+
queryKey: getSessionQueryKey(),
|
|
19
|
+
queryFn: async () => getSession(),
|
|
20
|
+
});
|
|
17
21
|
invariant(session.status === 'authenticated');
|
|
18
22
|
const depositsCount = await getDepositsCount({
|
|
19
23
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getFavoriteGames } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getFavoriteGamesQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useFavoriteGamesQuery = (config) => {
|
|
@@ -16,7 +17,10 @@ export const useFavoriteGamesQuery = (config) => {
|
|
|
16
17
|
: sessionQuery.data?.status === 'authenticated',
|
|
17
18
|
queryKey: getFavoriteGamesQueryKey(),
|
|
18
19
|
queryFn: async ({ signal }) => {
|
|
19
|
-
const session = await
|
|
20
|
+
const session = await getQueryClient().fetchQuery({
|
|
21
|
+
queryKey: getSessionQueryKey(),
|
|
22
|
+
queryFn: async () => getSession(),
|
|
23
|
+
});
|
|
20
24
|
invariant(session.status === 'authenticated');
|
|
21
25
|
const favoriteGames = getFavoriteGames({
|
|
22
26
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getFile } from '../../services/file.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getFileQueryKey, getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useFileQuery = (id, config) => {
|
|
@@ -15,7 +16,10 @@ export const useFileQuery = (id, config) => {
|
|
|
15
16
|
: sessionQuery.data?.status === 'authenticated',
|
|
16
17
|
queryKey: getFileQueryKey(id),
|
|
17
18
|
queryFn: async ({ signal }) => {
|
|
18
|
-
const session = await
|
|
19
|
+
const session = await getQueryClient().fetchQuery({
|
|
20
|
+
queryKey: getSessionQueryKey(),
|
|
21
|
+
queryFn: async () => getSession(),
|
|
22
|
+
});
|
|
19
23
|
invariant(session.status === 'authenticated');
|
|
20
24
|
const file = await getFile(id, {
|
|
21
25
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getInstapayBankList } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getInstapayBankListQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useInstapayBankListQuery = (config) => {
|
|
@@ -16,7 +17,10 @@ export const useInstapayBankListQuery = (config) => {
|
|
|
16
17
|
: sessionQuery.data?.status === 'authenticated',
|
|
17
18
|
queryKey: getInstapayBankListQueryKey(),
|
|
18
19
|
queryFn: async ({ signal }) => {
|
|
19
|
-
const session = await
|
|
20
|
+
const session = await getQueryClient().fetchQuery({
|
|
21
|
+
queryKey: getSessionQueryKey(),
|
|
22
|
+
queryFn: async () => getSession(),
|
|
23
|
+
});
|
|
20
24
|
invariant(session.status === 'authenticated');
|
|
21
25
|
const instapayBankList = await getInstapayBankList({
|
|
22
26
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { validateMayaSession } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getIsMayaSessionValidQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useOnMMA } from './useOnMMA.js';
|
|
7
8
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
@@ -22,7 +23,10 @@ export const useIsMayaSessionValidQuery = (config) => {
|
|
|
22
23
|
: sessionQuery.data?.status === 'authenticated',
|
|
23
24
|
queryKey: getIsMayaSessionValidQueryKey(),
|
|
24
25
|
queryFn: async ({ signal }) => {
|
|
25
|
-
const session = await
|
|
26
|
+
const session = await getQueryClient().fetchQuery({
|
|
27
|
+
queryKey: getSessionQueryKey(),
|
|
28
|
+
queryFn: async () => getSession(),
|
|
29
|
+
});
|
|
26
30
|
invariant(session.status === 'authenticated');
|
|
27
31
|
try {
|
|
28
32
|
await validateMayaSession({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getMemberVerification } from '../../services/account.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getMemberVerificationQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useMemberVerificationQuery = (config) => {
|
|
@@ -11,7 +12,10 @@ export const useMemberVerificationQuery = (config) => {
|
|
|
11
12
|
...config,
|
|
12
13
|
queryKey: getMemberVerificationQueryKey(),
|
|
13
14
|
queryFn: async ({ signal }) => {
|
|
14
|
-
const session = await
|
|
15
|
+
const session = await getQueryClient().fetchQuery({
|
|
16
|
+
queryKey: getSessionQueryKey(),
|
|
17
|
+
queryFn: async () => getSession(),
|
|
18
|
+
});
|
|
15
19
|
invariant(session.status === 'authenticated');
|
|
16
20
|
return await getMemberVerification({
|
|
17
21
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getMessages } from '../../services/trigger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getMessagesQueryKey, getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useMessagesQuery = (input, config) => {
|
|
@@ -14,7 +15,10 @@ export const useMessagesQuery = (input, config) => {
|
|
|
14
15
|
: sessionQuery.data?.status === 'authenticated',
|
|
15
16
|
queryKey: getMessagesQueryKey(input),
|
|
16
17
|
queryFn: async ({ pageParam, signal }) => {
|
|
17
|
-
const session = await
|
|
18
|
+
const session = await getQueryClient().fetchQuery({
|
|
19
|
+
queryKey: getSessionQueryKey(),
|
|
20
|
+
queryFn: async () => getSession(),
|
|
21
|
+
});
|
|
18
22
|
invariant(session.status === 'authenticated');
|
|
19
23
|
return getMessages({ ...input, after: pageParam }, {
|
|
20
24
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getOnboardingStatus } from '../../services/portal.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getOnboardingStatusQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useOnboardingStatusQuery = (config) => {
|
|
@@ -13,7 +14,10 @@ export const useOnboardingStatusQuery = (config) => {
|
|
|
13
14
|
: sessionQuery.data?.status === 'authenticated',
|
|
14
15
|
queryKey: getOnboardingStatusQueryKey(),
|
|
15
16
|
queryFn: async ({ signal }) => {
|
|
16
|
-
const session = await
|
|
17
|
+
const session = await getQueryClient().fetchQuery({
|
|
18
|
+
queryKey: getSessionQueryKey(),
|
|
19
|
+
queryFn: async () => getSession(),
|
|
20
|
+
});
|
|
17
21
|
invariant(session.status === 'authenticated');
|
|
18
22
|
const status = await getOnboardingStatus({
|
|
19
23
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getPaymentSettings } from '../../services/account.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getPaymentSettingsQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const usePaymentSettingsQuery = (config) => {
|
|
@@ -13,7 +14,10 @@ export const usePaymentSettingsQuery = (config) => {
|
|
|
13
14
|
: sessionQuery.data?.status === 'authenticated',
|
|
14
15
|
queryKey: getPaymentSettingsQueryKey(),
|
|
15
16
|
queryFn: async ({ signal }) => {
|
|
16
|
-
const session = await
|
|
17
|
+
const session = await getQueryClient().fetchQuery({
|
|
18
|
+
queryKey: getSessionQueryKey(),
|
|
19
|
+
queryFn: async () => getSession(),
|
|
20
|
+
});
|
|
17
21
|
invariant(session.status === 'authenticated');
|
|
18
22
|
return await getPaymentSettings({
|
|
19
23
|
signal,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getProfileCompletion } from '../../services/account.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getProfileCompletionQueryKey, getSessionQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useProfileCompletionQuery = (config) => {
|
|
@@ -13,7 +14,10 @@ export const useProfileCompletionQuery = (config) => {
|
|
|
13
14
|
: sessionQuery.data?.status === 'authenticated',
|
|
14
15
|
queryKey: getProfileCompletionQueryKey(),
|
|
15
16
|
queryFn: async ({ signal }) => {
|
|
16
|
-
const session = await
|
|
17
|
+
const session = await getQueryClient().fetchQuery({
|
|
18
|
+
queryKey: getSessionQueryKey(),
|
|
19
|
+
queryFn: async () => getSession(),
|
|
20
|
+
});
|
|
17
21
|
invariant(session.status === 'authenticated');
|
|
18
22
|
return await getProfileCompletion({
|
|
19
23
|
signal,
|