@oxyhq/services 6.9.46 → 6.10.2
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/lib/commonjs/index.js +36 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -20
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/ActingAsBanner.js +0 -4
- package/lib/commonjs/ui/components/ActingAsBanner.js.map +1 -1
- package/lib/commonjs/ui/components/ActivityIndicator.js +1 -1
- package/lib/commonjs/ui/components/ActivityIndicator.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +0 -2
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheet.js +33 -398
- package/lib/commonjs/ui/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +8 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +3 -5
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +0 -5
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/Icon.js +6 -7
- package/lib/commonjs/ui/components/Icon.js.map +1 -1
- package/lib/commonjs/ui/components/IconButton/IconButton.js +1 -5
- package/lib/commonjs/ui/components/IconButton/IconButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +0 -2
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +100 -37
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +23 -9
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +11 -8
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/QuickActions.js +2 -2
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +139 -284
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +0 -2
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/TextField.js +0 -1
- package/lib/commonjs/ui/components/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +0 -2
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +0 -2
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +80 -76
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +6 -8
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +18 -23
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/styles.js +213 -25
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -1
- package/lib/commonjs/ui/components/logo/LogoIcon.js +63 -0
- package/lib/commonjs/ui/components/logo/LogoIcon.js.map +1 -0
- package/lib/commonjs/ui/components/logo/LogoText.js +50 -0
- package/lib/commonjs/ui/components/logo/LogoText.js.map +1 -0
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +54 -88
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/paymentStyles.js +2 -10
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/commonjs/ui/components/styles/overlay.js +7 -9
- package/lib/commonjs/ui/components/styles/overlay.js.map +1 -1
- package/lib/commonjs/ui/components/theming.js +0 -1
- package/lib/commonjs/ui/components/theming.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +34 -21
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +1 -3
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/index.js +32 -12
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +10 -5
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +34 -0
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js.map +1 -0
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +235 -57
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +17 -13
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/index.js +6 -0
- package/lib/commonjs/ui/hooks/queries/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +2 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +80 -3
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js +36 -1
- package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queryClient.js +168 -70
- package/lib/commonjs/ui/hooks/queryClient.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +7 -7
- package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +0 -8
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +71 -20
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFileDownloadUrl.js +12 -41
- package/lib/commonjs/ui/hooks/useFileDownloadUrl.js.map +1 -1
- package/lib/commonjs/ui/hooks/useMutationStatus.js +86 -0
- package/lib/commonjs/ui/hooks/useMutationStatus.js.map +1 -0
- package/lib/commonjs/ui/hooks/useOnlineStatus.js +33 -0
- package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSessionSocket.js +101 -130
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +4 -4
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/commonjs/ui/index.js +1 -11
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +55 -3
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +16 -16
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +108 -123
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +20 -19
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +204 -161
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +18 -18
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +22 -23
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +939 -0
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +13 -20
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +10 -13
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +4 -4
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +17 -15
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +797 -159
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +8 -9
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +29 -21
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -5
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +5 -5
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +2 -2
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +75 -73
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +32 -21
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +4 -3
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +3 -3
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +57 -56
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +2 -3
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +39 -22
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +18 -21
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +0 -3
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +6 -10
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +6 -6
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +13 -19
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +5 -5
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/server.js +0 -5
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +0 -5
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/index.js +0 -11
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/commonjs/ui/styles/spacing.js +1 -42
- package/lib/commonjs/ui/styles/spacing.js.map +1 -1
- package/lib/commonjs/ui/styles/theme.js +0 -4
- package/lib/commonjs/ui/styles/theme.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +58 -39
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/sessionHelpers.js +3 -1
- package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/commonjs/ui/utils/userUtils.js +33 -16
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
- package/lib/module/index.js +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +0 -6
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/ActingAsBanner.js +0 -4
- package/lib/module/ui/components/ActingAsBanner.js.map +1 -1
- package/lib/module/ui/components/ActivityIndicator.js +1 -1
- package/lib/module/ui/components/ActivityIndicator.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +0 -2
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/BottomSheet.js +35 -400
- package/lib/module/ui/components/BottomSheet.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +9 -1
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +2 -4
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/Header.js +0 -5
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/Icon.js +6 -7
- package/lib/module/ui/components/Icon.js.map +1 -1
- package/lib/module/ui/components/IconButton/IconButton.js +1 -5
- package/lib/module/ui/components/IconButton/IconButton.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +0 -2
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +103 -40
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +23 -9
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +11 -8
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/QuickActions.js +2 -2
- package/lib/module/ui/components/QuickActions.js.map +1 -1
- package/lib/module/ui/components/SignInModal.js +137 -284
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +0 -2
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/TextField.js +0 -1
- package/lib/module/ui/components/TextField.js.map +1 -1
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js +1 -1
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js +0 -2
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js +0 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +80 -75
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +6 -7
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +18 -22
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/fileManagement/styles.js +212 -24
- package/lib/module/ui/components/fileManagement/styles.js.map +1 -1
- package/lib/module/ui/components/logo/LogoIcon.js +56 -0
- package/lib/module/ui/components/logo/LogoIcon.js.map +1 -0
- package/lib/module/ui/components/logo/LogoText.js +43 -0
- package/lib/module/ui/components/logo/LogoText.js.map +1 -0
- package/lib/module/ui/components/modals/DeleteAccountModal.js +55 -88
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/module/ui/components/payment/paymentStyles.js +2 -10
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/module/ui/components/styles/overlay.js +8 -8
- package/lib/module/ui/components/styles/overlay.js.map +1 -1
- package/lib/module/ui/components/theming.js +0 -1
- package/lib/module/ui/components/theming.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +32 -19
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +1 -3
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/index.js +5 -3
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +6 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationKeys.js +30 -0
- package/lib/module/ui/hooks/mutations/mutationKeys.js.map +1 -0
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +231 -52
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +9 -5
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/index.js +1 -1
- package/lib/module/ui/hooks/queries/index.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +2 -1
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +80 -3
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useSecurityQueries.js +35 -1
- package/lib/module/ui/hooks/queries/useSecurityQueries.js.map +1 -1
- package/lib/module/ui/hooks/queryClient.js +166 -68
- package/lib/module/ui/hooks/queryClient.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +3 -3
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +0 -3
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +73 -22
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useFileDownloadUrl.js +11 -39
- package/lib/module/ui/hooks/useFileDownloadUrl.js.map +1 -1
- package/lib/module/ui/hooks/useMutationStatus.js +82 -0
- package/lib/module/ui/hooks/useMutationStatus.js.map +1 -0
- package/lib/module/ui/hooks/useOnlineStatus.js +29 -0
- package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -0
- package/lib/module/ui/hooks/useSessionSocket.js +101 -130
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/module/ui/index.js +1 -10
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +54 -2
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +15 -14
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +96 -111
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +19 -18
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +189 -145
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +15 -15
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +14 -15
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +936 -0
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -0
- package/lib/module/ui/screens/CreateManagedAccountScreen.js +11 -18
- package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +8 -11
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +3 -3
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +14 -12
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +764 -125
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +2 -3
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +26 -17
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -3
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +3 -3
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +2 -2
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +60 -57
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +27 -16
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +4 -3
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +2 -2
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +48 -47
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +2 -3
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +40 -23
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +16 -19
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +0 -3
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +6 -10
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +6 -6
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +13 -19
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +5 -5
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/server.js +0 -4
- package/lib/module/ui/server.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +0 -5
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/index.js +0 -1
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +0 -42
- package/lib/module/ui/styles/spacing.js.map +1 -1
- package/lib/module/ui/styles/theme.js +0 -4
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +54 -36
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/utils/sessionHelpers.js +3 -1
- package/lib/module/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/module/ui/utils/userUtils.js +34 -16
- package/lib/module/ui/utils/userUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +7 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -2
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ActingAsBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts +27 -27
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Icon.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/Icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileCard.d.ts +4 -1
- package/lib/typescript/commonjs/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Outline.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/TextField/helpers.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/TextField/types.d.ts +0 -1
- package/lib/typescript/commonjs/ui/components/TextField/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts +0 -1
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts +0 -2
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts +200 -17
- package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/logo/LogoIcon.d.ts +22 -0
- package/lib/typescript/commonjs/ui/components/logo/LogoIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/logo/LogoText.d.ts +22 -0
- package/lib/typescript/commonjs/ui/components/logo/LogoText.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/paymentStyles.d.ts +0 -7
- package/lib/typescript/commonjs/ui/components/payment/paymentStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/styles/overlay.d.ts +3 -1
- package/lib/typescript/commonjs/ui/components/styles/overlay.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/theming.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/index.d.ts +5 -3
- package/lib/typescript/commonjs/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts +11 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts +25 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +161 -9
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useServicesMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +1 -0
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +22 -8
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts +13 -3
- package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +7 -5
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queryClient.d.ts +57 -9
- package/lib/typescript/commonjs/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +0 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +10 -2
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFileDownloadUrl.d.ts +2 -6
- package/lib/typescript/commonjs/ui/hooks/useFileDownloadUrl.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useMutationStatus.d.ts +23 -0
- package/lib/typescript/commonjs/ui/hooks/useMutationStatus.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +13 -0
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSessionSocket.d.ts +1 -2
- package/lib/typescript/commonjs/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +1 -4
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +48 -2
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +49 -0
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/server.d.ts +0 -2
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/styles/authStyles.d.ts +0 -4
- package/lib/typescript/commonjs/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/styles/index.d.ts +0 -1
- package/lib/typescript/commonjs/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/styles/spacing.d.ts +0 -36
- package/lib/typescript/commonjs/ui/styles/spacing.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/styles/theme.d.ts +0 -1
- package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +39 -12
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/sessionHelpers.d.ts +3 -1
- package/lib/typescript/commonjs/ui/utils/sessionHelpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts +19 -18
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +7 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -2
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ActingAsBanner.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheet.d.ts +27 -27
- package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Icon.d.ts +3 -2
- package/lib/typescript/module/ui/components/Icon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileCard.d.ts +4 -1
- package/lib/typescript/module/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Outline.d.ts +2 -2
- package/lib/typescript/module/ui/components/TextField/helpers.d.ts +2 -2
- package/lib/typescript/module/ui/components/TextField/types.d.ts +0 -1
- package/lib/typescript/module/ui/components/TextField/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts +0 -1
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts +0 -2
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +3 -2
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/styles.d.ts +200 -17
- package/lib/typescript/module/ui/components/fileManagement/styles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/logo/LogoIcon.d.ts +22 -0
- package/lib/typescript/module/ui/components/logo/LogoIcon.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/logo/LogoText.d.ts +22 -0
- package/lib/typescript/module/ui/components/logo/LogoText.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +2 -2
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/paymentStyles.d.ts +0 -7
- package/lib/typescript/module/ui/components/payment/paymentStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/styles/overlay.d.ts +3 -1
- package/lib/typescript/module/ui/components/styles/overlay.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/theming.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/index.d.ts +5 -3
- package/lib/typescript/module/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts +11 -0
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts +25 -0
- package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +161 -9
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useServicesMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/index.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +1 -0
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +22 -8
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts +13 -3
- package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +7 -5
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queryClient.d.ts +57 -9
- package/lib/typescript/module/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +0 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +10 -2
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFileDownloadUrl.d.ts +2 -6
- package/lib/typescript/module/ui/hooks/useFileDownloadUrl.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useMutationStatus.d.ts +23 -0
- package/lib/typescript/module/ui/hooks/useMutationStatus.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +13 -0
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSessionSocket.d.ts +1 -2
- package/lib/typescript/module/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +1 -4
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +48 -2
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +49 -0
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/server.d.ts +0 -2
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/styles/authStyles.d.ts +0 -4
- package/lib/typescript/module/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/styles/index.d.ts +0 -1
- package/lib/typescript/module/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/styles/spacing.d.ts +0 -36
- package/lib/typescript/module/ui/styles/spacing.d.ts.map +1 -1
- package/lib/typescript/module/ui/styles/theme.d.ts +0 -1
- package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +39 -12
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/sessionHelpers.d.ts +3 -1
- package/lib/typescript/module/ui/utils/sessionHelpers.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/userUtils.d.ts +19 -18
- package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
- package/lib/typescript/types/expo-vector-icons.d.ts +7 -4
- package/package.json +64 -31
- package/src/index.ts +11 -4
- package/src/types/expo-vector-icons.d.ts +7 -4
- package/src/ui/client.ts +0 -6
- package/src/ui/components/ActingAsBanner.tsx +0 -4
- package/src/ui/components/ActivityIndicator.tsx +1 -1
- package/src/ui/components/Avatar.tsx +0 -2
- package/src/ui/components/BottomSheet.tsx +41 -440
- package/src/ui/components/BottomSheetRouter.tsx +12 -1
- package/src/ui/components/FollowButton.tsx +2 -4
- package/src/ui/components/Header.tsx +0 -5
- package/src/ui/components/Icon.tsx +12 -6
- package/src/ui/components/IconButton/IconButton.tsx +0 -3
- package/src/ui/components/OxyPayButton.tsx +0 -2
- package/src/ui/components/OxyProvider.tsx +127 -48
- package/src/ui/components/OxySignInButton.tsx +21 -9
- package/src/ui/components/ProfileCard.tsx +13 -10
- package/src/ui/components/QuickActions.tsx +2 -2
- package/src/ui/components/SignInModal.tsx +80 -199
- package/src/ui/components/StepBasedScreen.tsx +0 -2
- package/src/ui/components/TextField/Addons/Outline.tsx +2 -2
- package/src/ui/components/TextField/helpers.tsx +2 -2
- package/src/ui/components/TextField/types.tsx +0 -1
- package/src/ui/components/TextField.tsx +1 -2
- package/src/ui/components/TouchableRipple/TouchableRipple.native.tsx +1 -1
- package/src/ui/components/feedback/feedbackStyles.ts +0 -2
- package/src/ui/components/fileManagement/AnimatedButton.tsx +0 -1
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +71 -65
- package/src/ui/components/fileManagement/FileViewer.tsx +6 -9
- package/src/ui/components/fileManagement/UploadPreview.tsx +21 -25
- package/src/ui/components/fileManagement/styles.ts +206 -18
- package/src/ui/components/logo/LogoIcon.tsx +70 -0
- package/src/ui/components/logo/LogoText.tsx +70 -0
- package/src/ui/components/modals/DeleteAccountModal.tsx +56 -91
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
- package/src/ui/components/payment/paymentStyles.ts +0 -8
- package/src/ui/components/styles/overlay.tsx +17 -8
- package/src/ui/components/theming.tsx +0 -1
- package/src/ui/components/types.tsx +3 -2
- package/src/ui/context/OxyContext.tsx +34 -19
- package/src/ui/context/hooks/useAuthOperations.ts +1 -3
- package/src/ui/hooks/index.ts +11 -4
- package/src/ui/hooks/mutations/mutationFactory.ts +16 -1
- package/src/ui/hooks/mutations/mutationKeys.ts +28 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +251 -59
- package/src/ui/hooks/mutations/useServicesMutations.ts +10 -4
- package/src/ui/hooks/queries/index.ts +1 -0
- package/src/ui/hooks/queries/queryKeys.ts +2 -0
- package/src/ui/hooks/queries/useAccountQueries.ts +83 -3
- package/src/ui/hooks/queries/useSecurityQueries.ts +42 -2
- package/src/ui/hooks/queryClient.ts +194 -69
- package/src/ui/hooks/useAsyncAction.ts +3 -3
- package/src/ui/hooks/useAuth.ts +0 -2
- package/src/ui/hooks/useAvatarPicker.ts +108 -27
- package/src/ui/hooks/useFileDownloadUrl.ts +15 -39
- package/src/ui/hooks/useMutationStatus.ts +111 -0
- package/src/ui/hooks/useOnlineStatus.ts +29 -0
- package/src/ui/hooks/useSessionSocket.ts +136 -126
- package/src/ui/hooks/useSettingToggle.ts +1 -1
- package/src/ui/index.ts +0 -12
- package/src/ui/navigation/routes.ts +93 -2
- package/src/ui/screens/AccountCenterScreen.tsx +15 -13
- package/src/ui/screens/AccountOverviewScreen.tsx +94 -104
- package/src/ui/screens/AccountSettingsScreen.tsx +18 -17
- package/src/ui/screens/AccountSwitcherScreen.tsx +331 -298
- package/src/ui/screens/AccountVerificationScreen.tsx +15 -15
- package/src/ui/screens/AppInfoScreen.tsx +8 -13
- package/src/ui/screens/AvatarCropScreen.tsx +1073 -0
- package/src/ui/screens/CreateManagedAccountScreen.tsx +5 -16
- package/src/ui/screens/EditProfileFieldScreen.tsx +5 -10
- package/src/ui/screens/FAQScreen.tsx +3 -3
- package/src/ui/screens/FeedbackScreen.tsx +14 -12
- package/src/ui/screens/FileManagementScreen.tsx +885 -124
- package/src/ui/screens/HelpSupportScreen.tsx +2 -3
- package/src/ui/screens/HistoryViewScreen.tsx +24 -9
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -3
- package/src/ui/screens/LegalDocumentsScreen.tsx +3 -3
- package/src/ui/screens/PaymentGatewayScreen.tsx +2 -2
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +51 -56
- package/src/ui/screens/PrivacySettingsScreen.tsx +22 -20
- package/src/ui/screens/ProfileScreen.tsx +1 -2
- package/src/ui/screens/SavesCollectionsScreen.tsx +2 -2
- package/src/ui/screens/SessionManagementScreen.tsx +35 -47
- package/src/ui/screens/UserLinksScreen.tsx +1 -2
- package/src/ui/screens/UserListScreen.tsx +30 -19
- package/src/ui/screens/WelcomeNewUserScreen.tsx +14 -18
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +0 -3
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +4 -8
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +3 -4
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +13 -18
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +3 -4
- package/src/ui/server.ts +0 -4
- package/src/ui/styles/authStyles.ts +0 -5
- package/src/ui/styles/index.ts +0 -1
- package/src/ui/styles/spacing.ts +0 -43
- package/src/ui/styles/theme.ts +0 -4
- package/src/ui/utils/fileManagement.ts +66 -38
- package/src/ui/utils/sessionHelpers.ts +3 -1
- package/src/ui/utils/userUtils.ts +45 -29
- package/lib/commonjs/lib/sonner-safe.js +0 -32
- package/lib/commonjs/lib/sonner-safe.js.map +0 -1
- package/lib/commonjs/lib/sonner.js +0 -19
- package/lib/commonjs/lib/sonner.js.map +0 -1
- package/lib/commonjs/lib/sonner.native.js +0 -24
- package/lib/commonjs/lib/sonner.native.js.map +0 -1
- package/lib/commonjs/lib/sonner.web.js +0 -24
- package/lib/commonjs/lib/sonner.web.js.map +0 -1
- package/lib/commonjs/ui/hooks/useThemeColors.js +0 -33
- package/lib/commonjs/ui/hooks/useThemeColors.js.map +0 -1
- package/lib/commonjs/ui/hooks/useThemeStyles.js +0 -38
- package/lib/commonjs/ui/hooks/useThemeStyles.js.map +0 -1
- package/lib/commonjs/ui/styles/fonts.js +0 -84
- package/lib/commonjs/ui/styles/fonts.js.map +0 -1
- package/lib/module/lib/sonner-safe.js +0 -29
- package/lib/module/lib/sonner-safe.js.map +0 -1
- package/lib/module/lib/sonner.js +0 -14
- package/lib/module/lib/sonner.js.map +0 -1
- package/lib/module/lib/sonner.native.js +0 -19
- package/lib/module/lib/sonner.native.js.map +0 -1
- package/lib/module/lib/sonner.web.js +0 -19
- package/lib/module/lib/sonner.web.js.map +0 -1
- package/lib/module/ui/hooks/useThemeColors.js +0 -29
- package/lib/module/ui/hooks/useThemeColors.js.map +0 -1
- package/lib/module/ui/hooks/useThemeStyles.js +0 -33
- package/lib/module/ui/hooks/useThemeStyles.js.map +0 -1
- package/lib/module/ui/styles/fonts.js +0 -81
- package/lib/module/ui/styles/fonts.js.map +0 -1
- package/lib/typescript/commonjs/lib/sonner-safe.d.ts +0 -9
- package/lib/typescript/commonjs/lib/sonner-safe.d.ts.map +0 -1
- package/lib/typescript/commonjs/lib/sonner.d.ts +0 -12
- package/lib/typescript/commonjs/lib/sonner.d.ts.map +0 -1
- package/lib/typescript/commonjs/lib/sonner.native.d.ts +0 -15
- package/lib/typescript/commonjs/lib/sonner.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/lib/sonner.web.d.ts +0 -15
- package/lib/typescript/commonjs/lib/sonner.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts +0 -87
- package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts +0 -22
- package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/styles/fonts.d.ts +0 -21
- package/lib/typescript/commonjs/ui/styles/fonts.d.ts.map +0 -1
- package/lib/typescript/module/lib/sonner-safe.d.ts +0 -9
- package/lib/typescript/module/lib/sonner-safe.d.ts.map +0 -1
- package/lib/typescript/module/lib/sonner.d.ts +0 -12
- package/lib/typescript/module/lib/sonner.d.ts.map +0 -1
- package/lib/typescript/module/lib/sonner.native.d.ts +0 -15
- package/lib/typescript/module/lib/sonner.native.d.ts.map +0 -1
- package/lib/typescript/module/lib/sonner.web.d.ts +0 -15
- package/lib/typescript/module/lib/sonner.web.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/useThemeColors.d.ts +0 -87
- package/lib/typescript/module/ui/hooks/useThemeColors.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts +0 -22
- package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts.map +0 -1
- package/lib/typescript/module/ui/styles/fonts.d.ts +0 -21
- package/lib/typescript/module/ui/styles/fonts.d.ts.map +0 -1
- package/src/lib/sonner-safe.ts +0 -31
- package/src/lib/sonner.native.ts +0 -28
- package/src/lib/sonner.ts +0 -11
- package/src/lib/sonner.web.ts +0 -28
- package/src/ui/hooks/useThemeColors.ts +0 -27
- package/src/ui/hooks/useThemeStyles.ts +0 -50
- package/src/ui/styles/fonts.ts +0 -77
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useQuery, useQueries, useQueryClient } from '@tanstack/react-query';
|
|
2
3
|
import { authenticatedApiCall } from '@oxyhq/core';
|
|
3
4
|
import type { User } from '@oxyhq/core';
|
|
4
5
|
import { queryKeys } from './queryKeys';
|
|
6
|
+
import { mutationKeys } from '../mutations/mutationKeys';
|
|
5
7
|
import { useOxy } from '../../context/OxyContext';
|
|
8
|
+
import { useAuthStore } from '../../stores/authStore';
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* Get user profile by session ID
|
|
@@ -45,12 +48,23 @@ export const useUserProfiles = (sessionIds: string[], options?: { enabled?: bool
|
|
|
45
48
|
};
|
|
46
49
|
|
|
47
50
|
/**
|
|
48
|
-
* Get current authenticated user
|
|
51
|
+
* Get current authenticated user.
|
|
52
|
+
*
|
|
53
|
+
* The store-mirror effect must NOT overwrite the in-memory user while a
|
|
54
|
+
* write mutation is in flight — otherwise a stale background refetch
|
|
55
|
+
* landing between optimistic update and server-confirmed update would
|
|
56
|
+
* revert the optimistic value and flicker the UI.
|
|
57
|
+
*
|
|
58
|
+
* We gate the mirror on the mutation-cache state for any mutation that
|
|
59
|
+
* touches `User` shape (profile, avatar, settings, privacy). When any of
|
|
60
|
+
* those is in flight we skip the mirror entirely; the winning onSuccess
|
|
61
|
+
* handler is responsible for writing the final value to the store.
|
|
49
62
|
*/
|
|
50
63
|
export const useCurrentUser = (options?: { enabled?: boolean }) => {
|
|
51
64
|
const { oxyServices, activeSessionId, isAuthenticated } = useOxy();
|
|
65
|
+
const queryClient = useQueryClient();
|
|
52
66
|
|
|
53
|
-
|
|
67
|
+
const query = useQuery({
|
|
54
68
|
queryKey: queryKeys.accounts.current(),
|
|
55
69
|
queryFn: async () => {
|
|
56
70
|
if (!activeSessionId) {
|
|
@@ -62,8 +76,74 @@ export const useCurrentUser = (options?: { enabled?: boolean }) => {
|
|
|
62
76
|
staleTime: 1 * 60 * 1000, // 1 minute for current user
|
|
63
77
|
gcTime: 30 * 60 * 1000,
|
|
64
78
|
});
|
|
79
|
+
|
|
80
|
+
// Mirror fresh server-side user into the auth store so consumers reading
|
|
81
|
+
// useOxy().user pick up newly-arriving fields (createdAt, updatedAt, etc.).
|
|
82
|
+
//
|
|
83
|
+
// Guard 1 (mutation in flight): skip if ANY user-shape mutation is in
|
|
84
|
+
// flight — the in-progress optimistic value must not be reverted by a
|
|
85
|
+
// background refetch.
|
|
86
|
+
// Guard 2 (staleness): if the existing store user has a strictly newer
|
|
87
|
+
// `updatedAt` than the incoming data, skip. Protects against late-
|
|
88
|
+
// arriving refetches that race with an already-completed mutation.
|
|
89
|
+
const data = query.data;
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!data) return;
|
|
92
|
+
|
|
93
|
+
// Check for any write mutation that mutates the user shape. Match by
|
|
94
|
+
// any prefix of the user-write mutation keys we own — `isMutating`
|
|
95
|
+
// matches mutations whose `mutationKey` starts with the provided key.
|
|
96
|
+
const userWriteMutationsInFlight =
|
|
97
|
+
queryClient.isMutating({ mutationKey: mutationKeys.account.updateProfile }) +
|
|
98
|
+
queryClient.isMutating({ mutationKey: mutationKeys.account.uploadAvatar }) +
|
|
99
|
+
queryClient.isMutating({ mutationKey: mutationKeys.account.updateSettings }) +
|
|
100
|
+
queryClient.isMutating({ mutationKey: mutationKeys.account.updatePrivacySettings });
|
|
101
|
+
|
|
102
|
+
if (userWriteMutationsInFlight > 0) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// updatedAt-based staleness gate. Tolerates missing fields on either
|
|
107
|
+
// side: when the server response or stored user omits `updatedAt`
|
|
108
|
+
// (partial updates, legacy users), fall through to the mirror — the
|
|
109
|
+
// mutation-in-flight guard above is the primary defense.
|
|
110
|
+
const storedUser = useAuthStore.getState().user;
|
|
111
|
+
const incomingUpdatedAt = parseUpdatedAt(data.updatedAt);
|
|
112
|
+
const storedUpdatedAt = parseUpdatedAt(storedUser?.updatedAt);
|
|
113
|
+
if (
|
|
114
|
+
incomingUpdatedAt !== null &&
|
|
115
|
+
storedUpdatedAt !== null &&
|
|
116
|
+
incomingUpdatedAt < storedUpdatedAt
|
|
117
|
+
) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
useAuthStore.getState().setUser(data);
|
|
122
|
+
}, [data, queryClient]);
|
|
123
|
+
|
|
124
|
+
return query;
|
|
65
125
|
};
|
|
66
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Best-effort parser for the various `updatedAt` representations the API
|
|
129
|
+
* returns (ISO string, epoch number, Date instance, undefined). Returns
|
|
130
|
+
* `null` when the value can't be interpreted as a finite timestamp — the
|
|
131
|
+
* caller then falls back to the mutation-in-flight guard.
|
|
132
|
+
*/
|
|
133
|
+
function parseUpdatedAt(value: unknown): number | null {
|
|
134
|
+
if (value == null) return null;
|
|
135
|
+
if (typeof value === 'number') return Number.isFinite(value) ? value : null;
|
|
136
|
+
if (value instanceof Date) {
|
|
137
|
+
const t = value.getTime();
|
|
138
|
+
return Number.isFinite(t) ? t : null;
|
|
139
|
+
}
|
|
140
|
+
if (typeof value === 'string') {
|
|
141
|
+
const t = Date.parse(value);
|
|
142
|
+
return Number.isFinite(t) ? t : null;
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
67
147
|
/**
|
|
68
148
|
* Get user by ID
|
|
69
149
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
1
|
+
import { useQuery, useInfiniteQuery } from '@tanstack/react-query';
|
|
2
2
|
import { queryKeys } from './queryKeys';
|
|
3
3
|
import { useOxy } from '../../context/OxyContext';
|
|
4
|
-
import type { SecurityActivity, SecurityEventType } from '@oxyhq/core';
|
|
4
|
+
import type { SecurityActivity, SecurityActivityResponse, SecurityEventType } from '@oxyhq/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Get user's security activity with pagination
|
|
@@ -62,3 +62,43 @@ export const useRecentSecurityActivity = (limit = 10) => {
|
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Get user's security activity with infinite pagination.
|
|
67
|
+
* Each page returns up to `limit` events; `getNextPageParam` walks the
|
|
68
|
+
* `offset` cursor until the API reports `hasMore: false`.
|
|
69
|
+
*/
|
|
70
|
+
export const useInfiniteSecurityActivity = (
|
|
71
|
+
options?: {
|
|
72
|
+
limit?: number;
|
|
73
|
+
eventType?: SecurityEventType;
|
|
74
|
+
enabled?: boolean;
|
|
75
|
+
}
|
|
76
|
+
) => {
|
|
77
|
+
const { oxyServices, activeSessionId } = useOxy();
|
|
78
|
+
const limit = options?.limit ?? 30;
|
|
79
|
+
|
|
80
|
+
return useInfiniteQuery<SecurityActivityResponse, Error>({
|
|
81
|
+
queryKey: queryKeys.security.infinite(limit, options?.eventType),
|
|
82
|
+
queryFn: async ({ pageParam }) => {
|
|
83
|
+
if (!activeSessionId) {
|
|
84
|
+
throw new Error('No active session');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const offset = typeof pageParam === 'number' ? pageParam : 0;
|
|
88
|
+
return await oxyServices.getSecurityActivity(
|
|
89
|
+
limit,
|
|
90
|
+
offset,
|
|
91
|
+
options?.eventType
|
|
92
|
+
);
|
|
93
|
+
},
|
|
94
|
+
initialPageParam: 0,
|
|
95
|
+
getNextPageParam: (lastPage) => {
|
|
96
|
+
if (!lastPage.hasMore) return undefined;
|
|
97
|
+
return lastPage.offset + lastPage.limit;
|
|
98
|
+
},
|
|
99
|
+
enabled: (options?.enabled !== false) && !!activeSessionId,
|
|
100
|
+
staleTime: 5 * 60 * 1000, // 5 minutes
|
|
101
|
+
gcTime: 10 * 60 * 1000, // 10 minutes
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
@@ -1,74 +1,115 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Offline-first QueryClient with cross-restart persistence.
|
|
3
|
+
*
|
|
4
|
+
* Wires together:
|
|
5
|
+
* - TanStack Query with `networkMode: 'offlineFirst'` for queries and mutations
|
|
6
|
+
* so cached data is served immediately and mutations are queued (paused) while
|
|
7
|
+
* the browser/device reports offline.
|
|
8
|
+
* - `persistQueryClient(...)` from `@tanstack/react-query-persist-client` so that
|
|
9
|
+
* query results AND paused mutations survive a cold restart (kill-and-relaunch).
|
|
10
|
+
* - `onlineManager` resume hook so paused mutations replay the moment the
|
|
11
|
+
* network is reported back, even if the host app swapped in a custom
|
|
12
|
+
* onlineManager implementation.
|
|
13
|
+
*
|
|
14
|
+
* Storage layer:
|
|
15
|
+
* - React Native -> AsyncStorage via `createAsyncStoragePersister`.
|
|
16
|
+
* - Web -> localStorage via `createSyncStoragePersister` (wrapped in the
|
|
17
|
+
* async persister API for a single call site).
|
|
18
|
+
* - Both adapters are content-shape compatible with our `StorageInterface`.
|
|
19
|
+
*
|
|
20
|
+
* Whitelist policy:
|
|
21
|
+
* - Persist every account/user/session/privacy query and every queued mutation.
|
|
22
|
+
* - DO NOT persist large list queries (e.g. activity feeds) — they go stale
|
|
23
|
+
* fast and would balloon storage. Add new keys to `PERSISTED_QUERY_PREFIXES`
|
|
24
|
+
* when introducing reads that should survive restart.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { QueryClient, onlineManager, type Query, type Mutation } from '@tanstack/react-query';
|
|
28
|
+
import {
|
|
29
|
+
persistQueryClient,
|
|
30
|
+
type PersistedClient,
|
|
31
|
+
} from '@tanstack/react-query-persist-client';
|
|
32
|
+
import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister';
|
|
2
33
|
import { isDev } from '@oxyhq/core';
|
|
3
34
|
import type { StorageInterface } from '../utils/storageHelpers';
|
|
4
35
|
|
|
5
|
-
const QUERY_CACHE_KEY = '
|
|
6
|
-
const
|
|
36
|
+
const QUERY_CACHE_KEY = 'oxy_query_cache_v2';
|
|
37
|
+
const QUERY_CACHE_MAX_AGE = 30 * 24 * 60 * 60 * 1000; // 30 days
|
|
38
|
+
const QUERY_PERSIST_THROTTLE_MS = 1_000;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Query-key prefixes that should survive cold restart. Anything not listed
|
|
42
|
+
* is dropped during dehydration so the persisted blob stays small.
|
|
43
|
+
*
|
|
44
|
+
* Mutations are persisted independently (always) so the offline write queue
|
|
45
|
+
* works regardless of the read whitelist.
|
|
46
|
+
*/
|
|
47
|
+
const PERSISTED_QUERY_PREFIXES: ReadonlyArray<string> = [
|
|
48
|
+
'accounts',
|
|
49
|
+
'users',
|
|
50
|
+
'sessions',
|
|
51
|
+
'devices',
|
|
52
|
+
'privacy',
|
|
53
|
+
];
|
|
7
54
|
|
|
8
55
|
/**
|
|
9
|
-
*
|
|
56
|
+
* Adapt our `StorageInterface` (which always returns `null` for missing keys)
|
|
57
|
+
* to TanStack's `AsyncStorage` shape. The two are structurally identical
|
|
58
|
+
* apart from naming; this also gives us a single place to add error
|
|
59
|
+
* suppression if a host platform's storage throws.
|
|
10
60
|
*/
|
|
11
|
-
|
|
61
|
+
function adaptStorage(storage: StorageInterface): {
|
|
62
|
+
getItem: (key: string) => Promise<string | null>;
|
|
63
|
+
setItem: (key: string, value: string) => Promise<void>;
|
|
64
|
+
removeItem: (key: string) => Promise<void>;
|
|
65
|
+
} {
|
|
12
66
|
return {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
version: QUERY_CACHE_VERSION,
|
|
19
|
-
});
|
|
20
|
-
await storage.setItem(QUERY_CACHE_KEY, serialized);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
if (isDev()) {
|
|
23
|
-
console.warn('[QueryClient] Failed to persist cache:', error);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
restoreClient: async () => {
|
|
28
|
-
try {
|
|
29
|
-
const cached = await storage.getItem(QUERY_CACHE_KEY);
|
|
30
|
-
if (!cached) return undefined;
|
|
31
|
-
|
|
32
|
-
const parsed = JSON.parse(cached);
|
|
33
|
-
|
|
34
|
-
// Check version compatibility
|
|
35
|
-
if (parsed.version !== QUERY_CACHE_VERSION) {
|
|
36
|
-
// Clear old cache on version mismatch
|
|
37
|
-
await storage.removeItem(QUERY_CACHE_KEY);
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
67
|
+
getItem: (key) => storage.getItem(key),
|
|
68
|
+
setItem: (key, value) => storage.setItem(key, value),
|
|
69
|
+
removeItem: (key) => storage.removeItem(key),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
40
72
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Decide whether a given query should be written to persistent storage.
|
|
75
|
+
*
|
|
76
|
+
* Two gates:
|
|
77
|
+
* 1. The query must be in our prefix whitelist.
|
|
78
|
+
* 2. The query must have completed successfully at least once — there's no
|
|
79
|
+
* point persisting a `pending`/`error` state, and persisting `error` would
|
|
80
|
+
* leak failure objects across restarts.
|
|
81
|
+
*/
|
|
82
|
+
function shouldDehydrateQuery(query: Query): boolean {
|
|
83
|
+
if (query.state.status !== 'success') {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const head = query.queryKey[0];
|
|
87
|
+
if (typeof head !== 'string') {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
return PERSISTED_QUERY_PREFIXES.includes(head);
|
|
91
|
+
}
|
|
47
92
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
removeClient: async () => {
|
|
57
|
-
try {
|
|
58
|
-
await storage.removeItem(QUERY_CACHE_KEY);
|
|
59
|
-
} catch (error) {
|
|
60
|
-
if (isDev()) {
|
|
61
|
-
console.warn('[QueryClient] Failed to remove cache:', error);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
};
|
|
93
|
+
/**
|
|
94
|
+
* Persist every mutation regardless of status — paused mutations are
|
|
95
|
+
* exactly the ones that must survive restart to replay when online.
|
|
96
|
+
*/
|
|
97
|
+
function shouldDehydrateMutation(_mutation: Mutation): boolean {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
67
100
|
|
|
68
101
|
/**
|
|
69
|
-
* Create a QueryClient with offline-first
|
|
102
|
+
* Create a QueryClient with offline-first defaults.
|
|
103
|
+
*
|
|
104
|
+
* Mutations marked with `networkMode: 'offlineFirst'` are queued by TanStack
|
|
105
|
+
* Query when offline (status "paused") and resumed automatically when
|
|
106
|
+
* `onlineManager` transitions back to online. Network monitoring wiring lives
|
|
107
|
+
* in `OxyProvider.tsx`.
|
|
108
|
+
*
|
|
109
|
+
* Persistence is attached separately via `attachQueryPersistence(...)`.
|
|
110
|
+
* Splitting the steps lets test/SSR callers create a stateless client.
|
|
70
111
|
*/
|
|
71
|
-
export const createQueryClient = (
|
|
112
|
+
export const createQueryClient = (): QueryClient => {
|
|
72
113
|
const client = new QueryClient({
|
|
73
114
|
defaultOptions: {
|
|
74
115
|
queries: {
|
|
@@ -79,35 +120,119 @@ export const createQueryClient = (storage?: StorageInterface | null): QueryClien
|
|
|
79
120
|
// Retry 3 times with exponential backoff
|
|
80
121
|
retry: 3,
|
|
81
122
|
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 30000),
|
|
82
|
-
// Refetch on reconnect
|
|
123
|
+
// Refetch on reconnect so stale data is refreshed once online again.
|
|
83
124
|
refetchOnReconnect: true,
|
|
84
125
|
// Don't refetch on window focus (better for mobile)
|
|
85
126
|
refetchOnWindowFocus: false,
|
|
86
|
-
// Offline-first:
|
|
127
|
+
// Offline-first: serve cached data immediately, refetch in background.
|
|
87
128
|
networkMode: 'offlineFirst',
|
|
88
129
|
},
|
|
89
130
|
mutations: {
|
|
90
131
|
// Retry once for mutations
|
|
91
132
|
retry: 1,
|
|
92
|
-
// Offline-first: queue mutations when offline
|
|
133
|
+
// Offline-first: pause and queue mutations when offline.
|
|
93
134
|
networkMode: 'offlineFirst',
|
|
94
135
|
},
|
|
95
136
|
},
|
|
96
137
|
});
|
|
97
138
|
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
139
|
+
// Defensive: explicitly resume paused mutations whenever the network
|
|
140
|
+
// transitions back to online. TanStack Query does this internally too,
|
|
141
|
+
// but wiring it here keeps the behaviour robust if a custom onlineManager
|
|
142
|
+
// implementation is swapped in by the host app.
|
|
143
|
+
const unsubscribe = onlineManager.subscribe((isOnline) => {
|
|
144
|
+
if (isOnline) {
|
|
145
|
+
void client.getMutationCache().resumePausedMutations();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
Object.defineProperty(client, '__oxyOnlineUnsubscribe', {
|
|
150
|
+
value: unsubscribe,
|
|
151
|
+
enumerable: false,
|
|
152
|
+
configurable: true,
|
|
153
|
+
writable: false,
|
|
154
|
+
});
|
|
102
155
|
|
|
103
156
|
return client;
|
|
104
157
|
};
|
|
105
158
|
|
|
159
|
+
export interface AttachPersistenceResult {
|
|
160
|
+
/** Promise that resolves once the persisted cache has been restored. */
|
|
161
|
+
restored: Promise<void>;
|
|
162
|
+
/** Detach the persistence subscription (tests + teardown). */
|
|
163
|
+
unsubscribe: () => void;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Wire `persistQueryClient` to the supplied storage adapter.
|
|
168
|
+
*
|
|
169
|
+
* Returns once the in-flight restore promise is available so callers can
|
|
170
|
+
* `await result.restored` before rendering UI that depends on cached data.
|
|
171
|
+
*
|
|
172
|
+
* Safe to no-op if `storage` is null/undefined (e.g. server-side render
|
|
173
|
+
* with no host storage).
|
|
174
|
+
*/
|
|
175
|
+
export const attachQueryPersistence = (
|
|
176
|
+
queryClient: QueryClient,
|
|
177
|
+
storage: StorageInterface | null | undefined,
|
|
178
|
+
): AttachPersistenceResult => {
|
|
179
|
+
if (!storage) {
|
|
180
|
+
return {
|
|
181
|
+
restored: Promise.resolve(),
|
|
182
|
+
unsubscribe: () => {},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const persister = createAsyncStoragePersister({
|
|
187
|
+
storage: adaptStorage(storage),
|
|
188
|
+
key: QUERY_CACHE_KEY,
|
|
189
|
+
throttleTime: QUERY_PERSIST_THROTTLE_MS,
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
const [unsubscribe, restored] = persistQueryClient({
|
|
193
|
+
queryClient,
|
|
194
|
+
persister,
|
|
195
|
+
maxAge: QUERY_CACHE_MAX_AGE,
|
|
196
|
+
dehydrateOptions: {
|
|
197
|
+
shouldDehydrateQuery,
|
|
198
|
+
shouldDehydrateMutation,
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
restored.catch((error) => {
|
|
203
|
+
if (isDev()) {
|
|
204
|
+
console.warn('[QueryClient] Failed to restore persisted cache', error);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
return { unsubscribe, restored };
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// Legacy v1 cache key — kept so we can opportunistically purge stale blobs
|
|
212
|
+
// written by older builds. Safe to drop after a few releases.
|
|
213
|
+
const LEGACY_QUERY_CACHE_KEYS: ReadonlyArray<string> = ['oxy_query_cache'];
|
|
214
|
+
|
|
106
215
|
/**
|
|
107
|
-
*
|
|
216
|
+
* Remove the persisted query+mutation cache (used on full sign-out / data
|
|
217
|
+
* reset). Safe to call even if persistence was never attached. Also clears
|
|
218
|
+
* legacy cache keys from older builds.
|
|
108
219
|
*/
|
|
109
220
|
export const clearQueryCache = async (storage: StorageInterface): Promise<void> => {
|
|
110
|
-
const
|
|
111
|
-
await
|
|
221
|
+
const keys = [QUERY_CACHE_KEY, ...LEGACY_QUERY_CACHE_KEYS];
|
|
222
|
+
await Promise.all(
|
|
223
|
+
keys.map(async (key) => {
|
|
224
|
+
try {
|
|
225
|
+
await storage.removeItem(key);
|
|
226
|
+
} catch (error) {
|
|
227
|
+
if (isDev()) {
|
|
228
|
+
console.warn(`[QueryClient] Failed to clear persisted query cache (${key})`, error);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}),
|
|
232
|
+
);
|
|
112
233
|
};
|
|
113
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Re-export the persisted client shape so callers can type custom persisters.
|
|
237
|
+
*/
|
|
238
|
+
export type { PersistedClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useCallback } from 'react';
|
|
2
|
-
import { toast } from '
|
|
2
|
+
import { toast } from '@oxyhq/bloom';
|
|
3
3
|
|
|
4
4
|
interface UseAsyncActionOptions<T> {
|
|
5
5
|
/** Function to execute */
|
|
@@ -63,7 +63,7 @@ export function useAsyncAction<T = void>(
|
|
|
63
63
|
setError(null);
|
|
64
64
|
|
|
65
65
|
if (showLoadingToast && loadingMessage) {
|
|
66
|
-
toast.
|
|
66
|
+
toast.info(loadingMessage);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
try {
|
|
@@ -111,7 +111,7 @@ export async function executeWithToast<T>(
|
|
|
111
111
|
const { successMessage, errorMessage, loadingMessage } = options || {};
|
|
112
112
|
|
|
113
113
|
if (loadingMessage) {
|
|
114
|
-
toast.
|
|
114
|
+
toast.info(loadingMessage);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
try {
|
package/src/ui/hooks/useAuth.ts
CHANGED
|
@@ -2,18 +2,26 @@
|
|
|
2
2
|
* Avatar Picker Hook
|
|
3
3
|
*
|
|
4
4
|
* Extracts avatar selection logic from OxyContext for better modularity.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Flow:
|
|
7
|
+
* 1. Open the FileManagement bottom sheet in select mode for image files.
|
|
8
|
+
* 2. After the user picks an image, route to the AvatarCrop screen so they
|
|
9
|
+
* can square-crop + zoom before the avatar is set.
|
|
10
|
+
* 3. The cropped JPEG is uploaded as a NEW file via `oxyServices.assetUpload`
|
|
11
|
+
* and that file becomes the user's avatar.
|
|
12
|
+
*
|
|
13
|
+
* `expo-image-manipulator` is required for the crop step (declared as an
|
|
14
|
+
* optional peer in the consuming app) — see AvatarCropScreen.
|
|
7
15
|
*/
|
|
8
16
|
|
|
9
17
|
import { useCallback } from 'react';
|
|
10
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
11
|
-
import { translate } from '@oxyhq/core';
|
|
18
|
+
import type { FileMetadata, OxyServices } from '@oxyhq/core';
|
|
19
|
+
import { translate, updateAvatarVisibility } from '@oxyhq/core';
|
|
12
20
|
import type { QueryClient } from '@tanstack/react-query';
|
|
13
|
-
import { toast } from '
|
|
21
|
+
import { toast } from '@oxyhq/bloom';
|
|
14
22
|
import type { RouteName } from '../navigation/routes';
|
|
15
|
-
import { updateAvatarVisibility } from '@oxyhq/core';
|
|
16
23
|
import { updateProfileWithAvatar } from '../utils/avatarUtils';
|
|
24
|
+
import type { AvatarCropResult } from '../screens/AvatarCropScreen';
|
|
17
25
|
|
|
18
26
|
interface UseAvatarPickerOptions {
|
|
19
27
|
oxyServices: OxyServices;
|
|
@@ -23,6 +31,22 @@ interface UseAvatarPickerOptions {
|
|
|
23
31
|
showBottomSheet: (config: { screen: RouteName; props?: Record<string, unknown> }) => void;
|
|
24
32
|
}
|
|
25
33
|
|
|
34
|
+
/** Upload result shape returned by oxyServices.assetUpload (single-file path). */
|
|
35
|
+
interface AssetUploadResult {
|
|
36
|
+
file?: { id?: string };
|
|
37
|
+
files?: Array<{ id?: string }>;
|
|
38
|
+
id?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function extractUploadedFileId(result: AssetUploadResult | undefined): string | undefined {
|
|
42
|
+
if (!result) return undefined;
|
|
43
|
+
if (typeof result.id === 'string') return result.id;
|
|
44
|
+
if (result.file?.id) return result.file.id;
|
|
45
|
+
const first = result.files?.[0];
|
|
46
|
+
if (first?.id) return first.id;
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
26
50
|
export function useAvatarPicker({
|
|
27
51
|
oxyServices,
|
|
28
52
|
currentLanguage,
|
|
@@ -30,36 +54,93 @@ export function useAvatarPicker({
|
|
|
30
54
|
queryClient,
|
|
31
55
|
showBottomSheet,
|
|
32
56
|
}: UseAvatarPickerOptions) {
|
|
57
|
+
/**
|
|
58
|
+
* Final step: take the cropped JPEG, upload it as a new public file, then
|
|
59
|
+
* set it as the user's avatar. Fires success/error toasts.
|
|
60
|
+
*/
|
|
61
|
+
const finalizeCroppedAvatar = useCallback(
|
|
62
|
+
async (cropped: AvatarCropResult) => {
|
|
63
|
+
try {
|
|
64
|
+
const uploadResult = (await oxyServices.assetUpload(
|
|
65
|
+
{
|
|
66
|
+
uri: cropped.uri,
|
|
67
|
+
type: cropped.mime,
|
|
68
|
+
name: `avatar-${Date.now()}.jpg`,
|
|
69
|
+
},
|
|
70
|
+
'public',
|
|
71
|
+
)) as AssetUploadResult;
|
|
72
|
+
|
|
73
|
+
const newFileId = extractUploadedFileId(uploadResult);
|
|
74
|
+
if (!newFileId) {
|
|
75
|
+
throw new Error('Avatar upload succeeded but no file ID was returned');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
await updateAvatarVisibility(newFileId, oxyServices, 'useAvatarPicker');
|
|
79
|
+
await updateProfileWithAvatar(
|
|
80
|
+
{ avatar: newFileId },
|
|
81
|
+
oxyServices,
|
|
82
|
+
activeSessionId,
|
|
83
|
+
queryClient,
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
toast.success(
|
|
87
|
+
translate(currentLanguage ?? undefined, 'editProfile.toasts.avatarUpdated') ||
|
|
88
|
+
'Avatar updated',
|
|
89
|
+
);
|
|
90
|
+
} catch (e: unknown) {
|
|
91
|
+
const message = e instanceof Error ? e.message : undefined;
|
|
92
|
+
toast.error(
|
|
93
|
+
message ||
|
|
94
|
+
translate(currentLanguage ?? undefined, 'editProfile.toasts.updateAvatarFailed') ||
|
|
95
|
+
'Failed to update avatar',
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
[activeSessionId, currentLanguage, oxyServices, queryClient],
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* After the user picks a file in the FileManagement sheet, route to the
|
|
104
|
+
* crop screen with the file's download URL as the source image.
|
|
105
|
+
*/
|
|
106
|
+
const handleFilePicked = useCallback(
|
|
107
|
+
(file: FileMetadata) => {
|
|
108
|
+
if (!file.contentType?.startsWith('image/')) {
|
|
109
|
+
toast.error(
|
|
110
|
+
translate(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') ||
|
|
111
|
+
'Please select an image file',
|
|
112
|
+
);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Use the public download URL of the picked file as the crop source.
|
|
117
|
+
// The OxyServices file URL endpoints accept image variants, but for
|
|
118
|
+
// cropping we want the original — passing no variant returns it.
|
|
119
|
+
const sourceUri = oxyServices.getFileDownloadUrl(file.id);
|
|
120
|
+
|
|
121
|
+
showBottomSheet({
|
|
122
|
+
screen: 'AvatarCrop',
|
|
123
|
+
props: {
|
|
124
|
+
imageUri: sourceUri,
|
|
125
|
+
onConfirm: finalizeCroppedAvatar,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
[currentLanguage, finalizeCroppedAvatar, oxyServices, showBottomSheet],
|
|
130
|
+
);
|
|
131
|
+
|
|
33
132
|
const openAvatarPicker = useCallback(() => {
|
|
34
133
|
showBottomSheet({
|
|
35
|
-
screen: 'FileManagement'
|
|
134
|
+
screen: 'FileManagement',
|
|
36
135
|
props: {
|
|
37
136
|
selectMode: true,
|
|
38
137
|
multiSelect: false,
|
|
39
138
|
disabledMimeTypes: ['video/', 'audio/', 'application/pdf'],
|
|
40
139
|
afterSelect: 'none',
|
|
41
|
-
onSelect:
|
|
42
|
-
if (!file.contentType.startsWith('image/')) {
|
|
43
|
-
toast.error(translate(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') || 'Please select an image file');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
await updateAvatarVisibility(file.id, oxyServices, 'OxyContext');
|
|
48
|
-
await updateProfileWithAvatar(
|
|
49
|
-
{ avatar: file.id },
|
|
50
|
-
oxyServices,
|
|
51
|
-
activeSessionId,
|
|
52
|
-
queryClient
|
|
53
|
-
);
|
|
54
|
-
toast.success(translate(currentLanguage ?? undefined, 'editProfile.toasts.avatarUpdated') || 'Avatar updated');
|
|
55
|
-
} catch (e: unknown) {
|
|
56
|
-
const message = e instanceof Error ? e.message : undefined;
|
|
57
|
-
toast.error(message || translate(currentLanguage ?? undefined, 'editProfile.toasts.updateAvatarFailed') || 'Failed to update avatar');
|
|
58
|
-
}
|
|
59
|
-
},
|
|
140
|
+
onSelect: handleFilePicked,
|
|
60
141
|
},
|
|
61
142
|
});
|
|
62
|
-
}, [
|
|
143
|
+
}, [handleFilePicked, showBottomSheet]);
|
|
63
144
|
|
|
64
145
|
return { openAvatarPicker };
|
|
65
146
|
}
|