@oxyhq/services 13.0.2 → 13.1.0
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 +18 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenuButton.js +8 -10
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +1 -1
- package/lib/commonjs/ui/components/AccountSwitcher.js +65 -35
- package/lib/commonjs/ui/components/AccountSwitcher.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +233 -0
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -0
- package/lib/commonjs/ui/components/ProfileMenu.js +374 -0
- package/lib/commonjs/ui/components/ProfileMenu.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +213 -101
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +28 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +2 -2
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +12 -12
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +8 -7
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/index.js +14 -0
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +11 -6
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +6 -4
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +8 -7
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +13 -13
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +7 -7
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +5 -5
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +17 -18
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +9 -9
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +4 -4
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +6 -6
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +4 -4
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +4 -4
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/activeAuthuser.js +76 -8
- package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/module/index.js +5 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/AccountMenuButton.js +8 -10
- package/lib/module/ui/components/AccountMenuButton.js.map +1 -1
- package/lib/module/ui/components/AccountSwitcher.js +65 -35
- package/lib/module/ui/components/AccountSwitcher.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +228 -0
- package/lib/module/ui/components/ProfileButton.js.map +1 -0
- package/lib/module/ui/components/ProfileMenu.js +370 -0
- package/lib/module/ui/components/ProfileMenu.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +214 -102
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +29 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +2 -2
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/usePaymentQueries.js +12 -12
- package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +9 -7
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/index.js +2 -0
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +11 -6
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/module/ui/screens/CreateAccountScreen.js +6 -4
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +8 -7
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +13 -13
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +7 -7
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +5 -5
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +17 -18
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +9 -9
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +1 -1
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +4 -4
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +6 -6
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +6 -6
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +4 -4
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +4 -4
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/utils/activeAuthuser.js +74 -9
- package/lib/module/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +5 -7
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ActivityIndicator.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CrossFadeIcon.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/CrossFadeIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/HelperText.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/HelperText.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +46 -0
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +39 -0
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Outline.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Outline.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Underline.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Underline.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldAffix.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldIcon.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Label/InputLabel.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Label/LabelBackground.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/Label/LabelBackground.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldFlat.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldFlat.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldOutlined.d.ts +2 -1
- package/lib/typescript/commonjs/ui/components/TextField/TextFieldOutlined.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +11 -26
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/ThemeContext.d.ts +1 -1
- package/lib/typescript/commonjs/ui/context/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +2 -0
- package/lib/typescript/commonjs/ui/index.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 +3 -3
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +24 -0
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +64 -61
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +26 -26
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +5 -7
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +1 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ActivityIndicator.d.ts +2 -2
- package/lib/typescript/module/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CrossFadeIcon.d.ts +4 -3
- package/lib/typescript/module/ui/components/CrossFadeIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/HelperText.d.ts +1 -1
- package/lib/typescript/module/ui/components/HelperText.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Icon.d.ts +1 -1
- package/lib/typescript/module/ui/components/Icon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/IconButton/IconButton.d.ts +3 -3
- package/lib/typescript/module/ui/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/IconButton/utils.d.ts +1 -1
- package/lib/typescript/module/ui/components/IconButton/utils.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts +1 -1
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +46 -0
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts +39 -0
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts +2 -2
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Surface.d.ts +2 -2
- package/lib/typescript/module/ui/components/Surface.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Outline.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/Addons/Outline.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Underline.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/Addons/Underline.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +3 -3
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAdornment.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAffix.d.ts +3 -3
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAffix.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldIcon.d.ts +4 -4
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/types.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/utils.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/utils.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Label/InputLabel.d.ts +2 -2
- package/lib/typescript/module/ui/components/TextField/Label/InputLabel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Label/LabelBackground.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/Label/LabelBackground.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/TextFieldFlat.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/TextFieldFlat.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/TextFieldOutlined.d.ts +3 -2
- package/lib/typescript/module/ui/components/TextField/TextFieldOutlined.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/helpers.d.ts +3 -3
- package/lib/typescript/module/ui/components/TextField/helpers.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/types.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField.d.ts +4 -4
- package/lib/typescript/module/ui/components/TextField.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.d.ts +3 -3
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts +3 -3
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/utils.d.ts +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/utils.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Typography/AnimatedText.d.ts +3 -3
- package/lib/typescript/module/ui/components/Typography/AnimatedText.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts +1 -1
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/ProgressIndicator.d.ts +1 -1
- package/lib/typescript/module/ui/components/feedback/ProgressIndicator.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/constants.d.ts +1 -1
- package/lib/typescript/module/ui/components/feedback/constants.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/useFeedbackForm.d.ts +1 -1
- package/lib/typescript/module/ui/components/feedback/useFeedbackForm.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentDetailsStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentMethodStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentMethodStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentReviewStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentReviewStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSuccessStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSummaryStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/constants.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/constants.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/paymentStyles.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/paymentStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/theming.d.ts +1 -1
- package/lib/typescript/module/ui/components/theming.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts +14 -29
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/ThemeContext.d.ts +1 -1
- package/lib/typescript/module/ui/context/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +2 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queryClient.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useLanguageManagement.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useLanguageManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useStorage.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useStorage.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +30 -28
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +4 -4
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/server.d.ts +2 -2
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/fileManagement.d.ts +1 -1
- package/lib/typescript/module/ui/types/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +24 -0
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/package.json +21 -20
- package/src/index.ts +8 -5
- package/src/ui/components/AccountMenuButton.tsx +9 -11
- package/src/ui/components/AccountSwitcher.tsx +71 -37
- package/src/ui/components/ProfileButton.tsx +270 -0
- package/src/ui/components/ProfileMenu.tsx +416 -0
- package/src/ui/context/OxyContext.tsx +217 -130
- package/src/ui/context/hooks/useAuthOperations.ts +35 -2
- package/src/ui/hooks/queries/useAccountQueries.ts +2 -2
- package/src/ui/hooks/queries/usePaymentQueries.ts +12 -12
- package/src/ui/hooks/queries/useServicesQueries.ts +9 -6
- package/src/ui/index.ts +2 -0
- package/src/ui/screens/AccountSettingsScreen.tsx +9 -5
- package/src/ui/screens/AccountSwitcherScreen.tsx +3 -3
- package/src/ui/screens/CreateAccountScreen.tsx +6 -4
- package/src/ui/screens/EditProfileFieldScreen.tsx +8 -7
- package/src/ui/screens/FileManagementScreen.tsx +13 -13
- package/src/ui/screens/HistoryViewScreen.tsx +7 -7
- package/src/ui/screens/LanguageSelectorScreen.tsx +5 -5
- package/src/ui/screens/ManageAccountScreen.tsx +17 -18
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +3 -3
- package/src/ui/screens/PrivacySettingsScreen.tsx +9 -9
- package/src/ui/screens/ProfileScreen.tsx +1 -1
- package/src/ui/screens/SavesCollectionsScreen.tsx +5 -5
- package/src/ui/screens/SearchSettingsScreen.tsx +6 -6
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/trust/TrustCenterScreen.tsx +5 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +4 -4
- package/src/ui/utils/__tests__/activeAuthuser.test.ts +75 -0
- package/src/ui/utils/activeAuthuser.ts +74 -8
- package/lib/commonjs/ui/components/ActiveAccountBanner.js +0 -144
- package/lib/commonjs/ui/components/ActiveAccountBanner.js.map +0 -1
- package/lib/module/ui/components/ActiveAccountBanner.js +0 -141
- package/lib/module/ui/components/ActiveAccountBanner.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/ActiveAccountBanner.d.ts +0 -4
- package/lib/typescript/commonjs/ui/components/ActiveAccountBanner.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ActiveAccountBanner.d.ts +0 -4
- package/lib/typescript/module/ui/components/ActiveAccountBanner.d.ts.map +0 -1
- package/src/ui/components/ActiveAccountBanner.tsx +0 -130
|
@@ -5,8 +5,11 @@ import { queryKeys } from './queryKeys';
|
|
|
5
5
|
import { useOxy } from '../../context/OxyContext';
|
|
6
6
|
import { fetchSessionsWithFallback, mapSessionsToClient } from '../../utils/sessionHelpers';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
// Per-account query scope. In the real-session switch model the active session
|
|
9
|
+
// id uniquely identifies the active account (switching mints a new session), so
|
|
10
|
+
// it alone scopes the cache — no separate acting-as key is needed.
|
|
11
|
+
const accountQueryScope = (activeSessionId: string | null): string =>
|
|
12
|
+
`${activeSessionId ?? 'no-session'}`;
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Get all active sessions for the current user
|
|
@@ -93,10 +96,10 @@ export const useDeviceSessions = (options?: { enabled?: boolean }) => {
|
|
|
93
96
|
* Get user devices
|
|
94
97
|
*/
|
|
95
98
|
export const useUserDevices = (options?: { enabled?: boolean }) => {
|
|
96
|
-
const { oxyServices, isAuthenticated, activeSessionId
|
|
99
|
+
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
97
100
|
|
|
98
101
|
return useQuery({
|
|
99
|
-
queryKey: queryKeys.devices.list(accountQueryScope(activeSessionId
|
|
102
|
+
queryKey: queryKeys.devices.list(accountQueryScope(activeSessionId)),
|
|
100
103
|
queryFn: async () => {
|
|
101
104
|
return authenticatedApiCall(
|
|
102
105
|
oxyServices,
|
|
@@ -135,10 +138,10 @@ export const useSecurityInfo = (options?: { enabled?: boolean }) => {
|
|
|
135
138
|
* `useEffect` fetches.
|
|
136
139
|
*/
|
|
137
140
|
export const useAccountStorageUsage = (options?: { enabled?: boolean }) => {
|
|
138
|
-
const { oxyServices, isAuthenticated, activeSessionId
|
|
141
|
+
const { oxyServices, isAuthenticated, activeSessionId } = useOxy();
|
|
139
142
|
|
|
140
143
|
return useQuery<AccountStorageUsageResponse>({
|
|
141
|
-
queryKey: queryKeys.storage.usage(accountQueryScope(activeSessionId
|
|
144
|
+
queryKey: queryKeys.storage.usage(accountQueryScope(activeSessionId)),
|
|
142
145
|
queryFn: async () => {
|
|
143
146
|
return authenticatedApiCall(
|
|
144
147
|
oxyServices,
|
package/src/ui/index.ts
CHANGED
|
@@ -27,6 +27,8 @@ export { FontLoader, setupFonts } from './components/FontLoader';
|
|
|
27
27
|
export { default as OxyIcon } from './components/icon/OxyIcon';
|
|
28
28
|
export { default as AccountMenu } from './components/AccountMenu';
|
|
29
29
|
export { default as AccountMenuButton } from './components/AccountMenuButton';
|
|
30
|
+
export { default as ProfileButton } from './components/ProfileButton';
|
|
31
|
+
export { default as ProfileMenu } from './components/ProfileMenu';
|
|
30
32
|
export { default as AccountSwitcher, AccountSwitcherView } from './components/AccountSwitcher';
|
|
31
33
|
|
|
32
34
|
// Context + hooks
|
|
@@ -38,7 +38,7 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, nav
|
|
|
38
38
|
const bloomTheme = useTheme();
|
|
39
39
|
const colors = bloomTheme.colors;
|
|
40
40
|
const { t } = useI18n();
|
|
41
|
-
const { oxyServices, canUsePrivateApi,
|
|
41
|
+
const { oxyServices, canUsePrivateApi, user, accounts, switchToAccount } = useOxy();
|
|
42
42
|
const queryClient = useQueryClient();
|
|
43
43
|
|
|
44
44
|
const id = typeof accountId === 'string' ? accountId : '';
|
|
@@ -91,10 +91,14 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, nav
|
|
|
91
91
|
const archiveMutation = useMutation({
|
|
92
92
|
mutationKey: ['accounts', 'archive', id],
|
|
93
93
|
mutationFn: () => oxyServices.archiveAccount(id),
|
|
94
|
-
onSuccess: () => {
|
|
95
|
-
// If
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
onSuccess: async () => {
|
|
95
|
+
// If we archived the account we're currently signed in AS, switch back to
|
|
96
|
+
// the personal account so the app isn't left as an archived identity.
|
|
97
|
+
if (user?.id === id) {
|
|
98
|
+
const personal = accounts.find((node) => node.relationship === 'self');
|
|
99
|
+
if (personal) {
|
|
100
|
+
await switchToAccount(personal.accountId).catch(() => undefined);
|
|
101
|
+
}
|
|
98
102
|
}
|
|
99
103
|
queryClient.invalidateQueries({ queryKey: ['accounts'] });
|
|
100
104
|
toast.success(t('accounts.settings.toasts.archived') || 'Account archived');
|
|
@@ -8,9 +8,9 @@ import { useI18n } from '../hooks/useI18n';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Bottom-sheet route wrapper around {@link AccountSwitcherView}. Used when the
|
|
11
|
-
* switcher is opened as a sheet (e.g. from the
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* switcher is opened as a sheet (e.g. from the "Your accounts" entry in
|
|
12
|
+
* ManageAccount) rather than as the header-chip popover (which uses the
|
|
13
|
+
* `AccountSwitcher` modal directly).
|
|
14
14
|
*/
|
|
15
15
|
const AccountSwitcherScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, navigate }) => {
|
|
16
16
|
const { t } = useI18n();
|
|
@@ -84,7 +84,7 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
84
84
|
parentAccountId,
|
|
85
85
|
}) => {
|
|
86
86
|
const bloomTheme = useTheme();
|
|
87
|
-
const { oxyServices, createAccount,
|
|
87
|
+
const { oxyServices, createAccount, switchToAccount } = useOxy();
|
|
88
88
|
const { t } = useI18n();
|
|
89
89
|
|
|
90
90
|
const parentId = typeof parentAccountId === 'string' ? parentAccountId : undefined;
|
|
@@ -181,9 +181,11 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
181
181
|
|
|
182
182
|
toast.success(t('accounts.create.toasts.success') || 'Account created');
|
|
183
183
|
|
|
184
|
-
// Switch
|
|
184
|
+
// Switch INTO the new account (real-session switch — the whole app becomes
|
|
185
|
+
// it). Best-effort: creation already succeeded, so a switch hiccup should
|
|
186
|
+
// not surface as a create failure.
|
|
185
187
|
if (account.accountId) {
|
|
186
|
-
|
|
188
|
+
await switchToAccount(account.accountId).catch(() => undefined);
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
onClose?.();
|
|
@@ -195,7 +197,7 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
195
197
|
} finally {
|
|
196
198
|
setIsCreating(false);
|
|
197
199
|
}
|
|
198
|
-
}, [canCreate, kind, username, displayName, bio, parentId, createAccount,
|
|
200
|
+
}, [canCreate, kind, username, displayName, bio, parentId, createAccount, switchToAccount, onClose, t]);
|
|
199
201
|
|
|
200
202
|
// Status icon + color shown alongside the username field message
|
|
201
203
|
const usernameIsInvalid = usernameStatus === 'taken' || usernameStatus === 'invalid';
|
|
@@ -88,10 +88,11 @@ const EditProfileFieldScreen: React.FC<EditProfileFieldScreenProps> = ({
|
|
|
88
88
|
theme,
|
|
89
89
|
fieldType = 'displayName',
|
|
90
90
|
}) => {
|
|
91
|
-
// Editing "my" profile targets the ACTIVE account — writes
|
|
92
|
-
//
|
|
93
|
-
// active account (an org/project/bot when switched, else the
|
|
94
|
-
|
|
91
|
+
// Editing "my" profile targets the ACTIVE account — writes authenticate as
|
|
92
|
+
// the active session, which IS that account — so the initial field values
|
|
93
|
+
// must mirror the active account (an org/project/bot when switched, else the
|
|
94
|
+
// personal user).
|
|
95
|
+
const { user } = useOxy();
|
|
95
96
|
const { t } = useI18n();
|
|
96
97
|
const { saveProfile, updateField, isSaving } = useProfileEditing();
|
|
97
98
|
const bloomTheme = useTheme();
|
|
@@ -267,9 +268,9 @@ const EditProfileFieldScreen: React.FC<EditProfileFieldScreenProps> = ({
|
|
|
267
268
|
|
|
268
269
|
// Initialize field values from the active account's data
|
|
269
270
|
useEffect(() => {
|
|
270
|
-
if (!
|
|
271
|
+
if (!user) return;
|
|
271
272
|
|
|
272
|
-
const userData =
|
|
273
|
+
const userData = user;
|
|
273
274
|
|
|
274
275
|
if (fieldConfig.isList) {
|
|
275
276
|
if (fieldType === 'locations') {
|
|
@@ -319,7 +320,7 @@ const EditProfileFieldScreen: React.FC<EditProfileFieldScreenProps> = ({
|
|
|
319
320
|
});
|
|
320
321
|
setFieldValues(initialValues);
|
|
321
322
|
}
|
|
322
|
-
}, [
|
|
323
|
+
}, [user, fieldConfig, fieldType]);
|
|
323
324
|
|
|
324
325
|
// Field change handler
|
|
325
326
|
const handleFieldChange = useCallback((key: string, value: string) => {
|
|
@@ -766,8 +766,8 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
766
766
|
// Use useOxy() hook for OxyContext values. Files are owned by the ACTIVE
|
|
767
767
|
// account (the org/project/bot when switched, else the personal user): the
|
|
768
768
|
// default file owner and every "is this mine?" ownership check resolve
|
|
769
|
-
// against `
|
|
770
|
-
const {
|
|
769
|
+
// against `user`, so switching shows/manages that account's files.
|
|
770
|
+
const { user, oxyServices } = useOxy();
|
|
771
771
|
const { t } = useI18n();
|
|
772
772
|
const uploadFileMutation = useUploadFile();
|
|
773
773
|
// Prompt controls
|
|
@@ -1036,7 +1036,7 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
1036
1036
|
const backgroundColor = colors.backgroundSecondary;
|
|
1037
1037
|
const borderColor = colors.border;
|
|
1038
1038
|
|
|
1039
|
-
const targetUserId = userId ||
|
|
1039
|
+
const targetUserId = userId || user?.id;
|
|
1040
1040
|
|
|
1041
1041
|
const storeSetUploading = useFileStore(s => s.setUploading);
|
|
1042
1042
|
const storeSetUploadProgress = useFileStore(s => s.setUploadProgress);
|
|
@@ -2290,11 +2290,11 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
2290
2290
|
<Ionicons name="images-outline" size={64} color={colors.textTertiary} />
|
|
2291
2291
|
<Text style={[fileManagementStyles.emptyStateTitle, { color: colors.text }]}>{t('fileManagement.emptyPhotos.title')}</Text>
|
|
2292
2292
|
<Text style={[fileManagementStyles.emptyStateDescription, { color: colors.textSecondary }]}> {
|
|
2293
|
-
|
|
2293
|
+
user?.id === targetUserId
|
|
2294
2294
|
? t('fileManagement.emptyPhotos.ownDescription')
|
|
2295
2295
|
: t('fileManagement.emptyPhotos.otherDescription')
|
|
2296
2296
|
} </Text>
|
|
2297
|
-
{
|
|
2297
|
+
{user?.id === targetUserId && (
|
|
2298
2298
|
<TouchableOpacity
|
|
2299
2299
|
style={[fileManagementStyles.emptyStateButton, { backgroundColor: colors.primary }]}
|
|
2300
2300
|
onPress={handleFileUpload}
|
|
@@ -2360,7 +2360,7 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
2360
2360
|
}, [
|
|
2361
2361
|
filteredFiles,
|
|
2362
2362
|
colors,
|
|
2363
|
-
|
|
2363
|
+
user?.id,
|
|
2364
2364
|
targetUserId,
|
|
2365
2365
|
uploading,
|
|
2366
2366
|
handleFileUpload,
|
|
@@ -2384,12 +2384,12 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
2384
2384
|
<Ionicons name="folder-open-outline" size={64} color={colors.textTertiary} />
|
|
2385
2385
|
<Text style={[fileManagementStyles.emptyStateTitle, { color: colors.text }]}>{t('fileManagement.emptyFiles.title')}</Text>
|
|
2386
2386
|
<Text style={[fileManagementStyles.emptyStateDescription, { color: colors.textSecondary }]}>
|
|
2387
|
-
{
|
|
2387
|
+
{user?.id === targetUserId
|
|
2388
2388
|
? t('fileManagement.emptyFiles.ownDescription')
|
|
2389
2389
|
: t('fileManagement.emptyFiles.otherDescription')
|
|
2390
2390
|
}
|
|
2391
2391
|
</Text>
|
|
2392
|
-
{
|
|
2392
|
+
{user?.id === targetUserId && (
|
|
2393
2393
|
<TouchableOpacity
|
|
2394
2394
|
style={[fileManagementStyles.emptyStateButton, { backgroundColor: colors.primary }]}
|
|
2395
2395
|
onPress={handleFileUpload}
|
|
@@ -2599,7 +2599,7 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
2599
2599
|
const photosOnly = filteredFiles.filter(
|
|
2600
2600
|
(file) => file.contentType.startsWith('image/'),
|
|
2601
2601
|
);
|
|
2602
|
-
const isOwner =
|
|
2602
|
+
const isOwner = user?.id === targetUserId;
|
|
2603
2603
|
const allowUpload = isOwner && allowUploadInSelectMode;
|
|
2604
2604
|
|
|
2605
2605
|
return (
|
|
@@ -2657,14 +2657,14 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
2657
2657
|
onClose={handleCloseFile}
|
|
2658
2658
|
onDownload={handleFileDownload}
|
|
2659
2659
|
onDelete={confirmFileDelete}
|
|
2660
|
-
isOwner={
|
|
2660
|
+
isOwner={user?.id === targetUserId}
|
|
2661
2661
|
/>
|
|
2662
2662
|
<FileDetailsModal
|
|
2663
2663
|
control={fileDetailsControl}
|
|
2664
2664
|
file={selectedFile}
|
|
2665
2665
|
onDownload={handleFileDownload}
|
|
2666
2666
|
onDelete={confirmFileDelete}
|
|
2667
|
-
isOwner={
|
|
2667
|
+
isOwner={user?.id === targetUserId}
|
|
2668
2668
|
/>
|
|
2669
2669
|
</>
|
|
2670
2670
|
);
|
|
@@ -2840,7 +2840,7 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
2840
2840
|
color={colors.textSecondary}
|
|
2841
2841
|
/>
|
|
2842
2842
|
</TouchableOpacity>
|
|
2843
|
-
{
|
|
2843
|
+
{user?.id === targetUserId && (!selectMode || (selectMode && allowUploadInSelectMode)) && (
|
|
2844
2844
|
<TouchableOpacity
|
|
2845
2845
|
style={[
|
|
2846
2846
|
fileManagementStyles.uploadButton,
|
|
@@ -3013,7 +3013,7 @@ const FileManagementScreen: React.FC<FileManagementScreenProps> = ({
|
|
|
3013
3013
|
file={selectedFile}
|
|
3014
3014
|
onDownload={handleFileDownload}
|
|
3015
3015
|
onDelete={confirmFileDelete}
|
|
3016
|
-
isOwner={
|
|
3016
|
+
isOwner={user?.id === targetUserId}
|
|
3017
3017
|
/>
|
|
3018
3018
|
)}
|
|
3019
3019
|
|
|
@@ -17,7 +17,7 @@ interface HistoryItem { id: string; query: string; type: 'search' | 'browse'; ti
|
|
|
17
17
|
const HistoryViewScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) => {
|
|
18
18
|
// History is scoped to the ACTIVE account so a switch into an org/project/bot
|
|
19
19
|
// shows that account's history, not the device-session owner's.
|
|
20
|
-
const {
|
|
20
|
+
const { user } = useOxy();
|
|
21
21
|
const { t } = useI18n();
|
|
22
22
|
const bloomTheme = useTheme();
|
|
23
23
|
const [history, setHistory] = useState<HistoryItem[]>([]);
|
|
@@ -47,13 +47,13 @@ const HistoryViewScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) => {
|
|
|
47
47
|
try {
|
|
48
48
|
setIsLoading(true);
|
|
49
49
|
const storage = await getStorage();
|
|
50
|
-
const stored = await storage.getItem(`history_${
|
|
50
|
+
const stored = await storage.getItem(`history_${user?.id || 'guest'}`);
|
|
51
51
|
if (stored) { const parsed = JSON.parse(stored); setHistory(parsed.map((i: HistoryItem) => ({ ...i, timestamp: new Date(i.timestamp) }))); }
|
|
52
52
|
else setHistory([]);
|
|
53
53
|
} catch { setHistory([]); } finally { setIsLoading(false); }
|
|
54
54
|
};
|
|
55
55
|
load();
|
|
56
|
-
}, [
|
|
56
|
+
}, [user?.id]);
|
|
57
57
|
|
|
58
58
|
const handleDeleteLast15Minutes = useCallback(async () => {
|
|
59
59
|
try {
|
|
@@ -62,21 +62,21 @@ const HistoryViewScreen: React.FC<BaseScreenProps> = ({ onClose, goBack }) => {
|
|
|
62
62
|
const filtered = history.filter(item => item.timestamp < cutoff);
|
|
63
63
|
setHistory(filtered);
|
|
64
64
|
const storage = await getStorage();
|
|
65
|
-
await storage.setItem(`history_${
|
|
65
|
+
await storage.setItem(`history_${user?.id || 'guest'}`, JSON.stringify(filtered));
|
|
66
66
|
toast.success(t('history.deleteLast15Minutes.success') || 'Last 15 minutes deleted');
|
|
67
67
|
} catch (e) { if (__DEV__) console.error('Failed to delete history:', e); toast.error(t('history.deleteLast15Minutes.error') || 'Failed to delete history'); }
|
|
68
68
|
finally { setIsDeleting(false); }
|
|
69
|
-
}, [history,
|
|
69
|
+
}, [history, user?.id, t]);
|
|
70
70
|
|
|
71
71
|
const handleClearAll = useCallback(async () => {
|
|
72
72
|
try {
|
|
73
73
|
setIsDeleting(true); setHistory([]);
|
|
74
74
|
const storage = await getStorage();
|
|
75
|
-
await storage.removeItem(`history_${
|
|
75
|
+
await storage.removeItem(`history_${user?.id || 'guest'}`);
|
|
76
76
|
toast.success(t('history.clearAll.success') || 'History cleared');
|
|
77
77
|
} catch (e) { if (__DEV__) console.error('Failed to clear history:', e); toast.error(t('history.clearAll.error') || 'Failed to clear history'); }
|
|
78
78
|
finally { setIsDeleting(false); }
|
|
79
|
-
}, [
|
|
79
|
+
}, [user?.id, t]);
|
|
80
80
|
|
|
81
81
|
const formatTime = (date: Date) => {
|
|
82
82
|
const diff = new Date().getTime() - date.getTime();
|
|
@@ -34,9 +34,9 @@ const LanguageSelectorScreen: React.FC<LanguageSelectorScreenProps> = ({
|
|
|
34
34
|
theme,
|
|
35
35
|
}) => {
|
|
36
36
|
// Use useOxy() hook for OxyContext values. The language preference persists
|
|
37
|
-
// on the ACTIVE account's profile
|
|
38
|
-
// server sync on the active account.
|
|
39
|
-
const {
|
|
37
|
+
// on the ACTIVE account's profile — the active session IS that account — so
|
|
38
|
+
// gate the server sync on the active account.
|
|
39
|
+
const { user, currentLanguage, setLanguage, oxyServices, isAuthenticated } = useOxy();
|
|
40
40
|
const { t } = useI18n();
|
|
41
41
|
const bloomTheme = useTheme();
|
|
42
42
|
const normalizedTheme = normalizeTheme(theme);
|
|
@@ -55,7 +55,7 @@ const LanguageSelectorScreen: React.FC<LanguageSelectorScreenProps> = ({
|
|
|
55
55
|
let serverSyncFailed = false;
|
|
56
56
|
|
|
57
57
|
// If signed in, persist preference to backend user settings
|
|
58
|
-
if (isAuthenticated &&
|
|
58
|
+
if (isAuthenticated && user?.id) {
|
|
59
59
|
try {
|
|
60
60
|
await oxyServices.updateProfile({ language: languageId });
|
|
61
61
|
} catch (e: unknown) {
|
|
@@ -92,7 +92,7 @@ const LanguageSelectorScreen: React.FC<LanguageSelectorScreenProps> = ({
|
|
|
92
92
|
toast.error(t('language.saveFailed'));
|
|
93
93
|
setIsLoading(false);
|
|
94
94
|
}
|
|
95
|
-
}, [currentLanguage, isLoading, isAuthenticated,
|
|
95
|
+
}, [currentLanguage, isLoading, isAuthenticated, user?.id, oxyServices, setLanguage, t, onClose, goBack]);
|
|
96
96
|
|
|
97
97
|
// Filter the supported languages by the search query (name + native name).
|
|
98
98
|
const filteredLanguages = useMemo(() => {
|
|
@@ -89,7 +89,6 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
89
89
|
const { t, locale } = useI18n();
|
|
90
90
|
const {
|
|
91
91
|
user: contextUser,
|
|
92
|
-
activeAccount,
|
|
93
92
|
isAuthenticated,
|
|
94
93
|
oxyServices,
|
|
95
94
|
activeSessionId,
|
|
@@ -101,11 +100,11 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
101
100
|
const { data: userFromQuery, isLoading: userLoading } = useCurrentUser({
|
|
102
101
|
enabled: isAuthenticated,
|
|
103
102
|
});
|
|
104
|
-
// `user`
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
//
|
|
103
|
+
// `user` IS the active account. In the real-session switch model, switching
|
|
104
|
+
// into an org/project/bot makes it the active session, so `useOxy().user`
|
|
105
|
+
// (and the freshest `useCurrentUser` copy) already reflects the switched
|
|
106
|
+
// account everywhere — identity-of-me surfaces and management/GDPR actions
|
|
107
|
+
// alike read this single `user`.
|
|
109
108
|
const user = userFromQuery ?? contextUser;
|
|
110
109
|
|
|
111
110
|
const { data: subscription } = useUserSubscription({ enabled: isAuthenticated });
|
|
@@ -127,13 +126,13 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
127
126
|
const [signingOutAllDevices, setSigningOutAllDevices] = useState(false);
|
|
128
127
|
const [signingOut, setSigningOut] = useState(false);
|
|
129
128
|
|
|
130
|
-
const displayName = useMemo(() => getAccountDisplayName(
|
|
131
|
-
const handle = useMemo(() => getAccountFallbackHandle(
|
|
129
|
+
const displayName = useMemo(() => getAccountDisplayName(user, locale), [user, locale]);
|
|
130
|
+
const handle = useMemo(() => getAccountFallbackHandle(user), [user]);
|
|
132
131
|
const avatarUri = useMemo(() => {
|
|
133
|
-
return
|
|
134
|
-
? oxyServices.getFileDownloadUrl(
|
|
132
|
+
return user?.avatar
|
|
133
|
+
? oxyServices.getFileDownloadUrl(user.avatar, 'thumb')
|
|
135
134
|
: undefined;
|
|
136
|
-
}, [
|
|
135
|
+
}, [user?.avatar, oxyServices]);
|
|
137
136
|
|
|
138
137
|
const handleSignOut = useCallback(async () => {
|
|
139
138
|
if (signingOut) {
|
|
@@ -361,12 +360,12 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
361
360
|
</H4>
|
|
362
361
|
{handle ? (
|
|
363
362
|
<Text className="text-text-secondary text-sm mt-space-2" numberOfLines={1}>
|
|
364
|
-
{
|
|
363
|
+
{user?.username ? `@${handle}` : handle}
|
|
365
364
|
</Text>
|
|
366
365
|
) : null}
|
|
367
|
-
{
|
|
366
|
+
{user?.email ? (
|
|
368
367
|
<Text className="text-text-secondary text-sm mt-space-2" numberOfLines={1}>
|
|
369
|
-
{
|
|
368
|
+
{user.email}
|
|
370
369
|
</Text>
|
|
371
370
|
) : null}
|
|
372
371
|
</View>
|
|
@@ -418,9 +417,9 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
418
417
|
|| 'See how your profile looks to others'
|
|
419
418
|
}
|
|
420
419
|
onPress={() =>
|
|
421
|
-
|
|
420
|
+
user?.id ? navigate?.('Profile', { userId: user.id }) : undefined
|
|
422
421
|
}
|
|
423
|
-
disabled={!
|
|
422
|
+
disabled={!user?.id}
|
|
424
423
|
/>
|
|
425
424
|
<SettingsListItem
|
|
426
425
|
icon={
|
|
@@ -587,13 +586,13 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({
|
|
|
587
586
|
t('accountOverview.items.premium.title') || 'Oxy+'
|
|
588
587
|
}
|
|
589
588
|
description={
|
|
590
|
-
|
|
589
|
+
user?.isPremium
|
|
591
590
|
? (t('accountOverview.items.premium.manage') || 'Manage your premium plan')
|
|
592
591
|
: (t('accountOverview.items.premium.upgrade') || 'Upgrade to premium features')
|
|
593
592
|
}
|
|
594
593
|
onPress={() => navigate?.('PremiumSubscription')}
|
|
595
594
|
/>
|
|
596
|
-
{
|
|
595
|
+
{user?.isPremium || subscription?.status === 'active' ? (
|
|
597
596
|
<SettingsListItem
|
|
598
597
|
icon={
|
|
599
598
|
<SettingsIcon
|
|
@@ -93,7 +93,7 @@ const PremiumSubscriptionScreen: React.FC<BaseScreenProps> = ({
|
|
|
93
93
|
}) => {
|
|
94
94
|
// Premium state belongs to the ACTIVE account (the org/project/bot when
|
|
95
95
|
// switched, else the personal user), not the device-session owner.
|
|
96
|
-
const {
|
|
96
|
+
const { user } = useOxy();
|
|
97
97
|
const [loading, setLoading] = useState(true);
|
|
98
98
|
const [subscription, setSubscription] = useState<UserSubscription | null>(null);
|
|
99
99
|
const [plans, setPlans] = useState<SubscriptionPlan[]>([]);
|
|
@@ -329,7 +329,7 @@ const PremiumSubscriptionScreen: React.FC<BaseScreenProps> = ({
|
|
|
329
329
|
if (currentAppPackage) {
|
|
330
330
|
loadSubscriptionData();
|
|
331
331
|
}
|
|
332
|
-
}, [currentAppPackage,
|
|
332
|
+
}, [currentAppPackage, user?.isPremium]);
|
|
333
333
|
|
|
334
334
|
const detectCurrentApp = () => {
|
|
335
335
|
const detectedApp = 'mention';
|
|
@@ -346,7 +346,7 @@ const PremiumSubscriptionScreen: React.FC<BaseScreenProps> = ({
|
|
|
346
346
|
setPlans(availablePlans);
|
|
347
347
|
|
|
348
348
|
let currentSubscription: UserSubscription | null = null;
|
|
349
|
-
if (
|
|
349
|
+
if (user?.isPremium) {
|
|
350
350
|
currentSubscription = {
|
|
351
351
|
id: 'sub_12345',
|
|
352
352
|
planId: 'oxy-insider',
|
|
@@ -67,7 +67,7 @@ const PrivacySettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
67
67
|
}) => {
|
|
68
68
|
// Privacy settings belong to the ACTIVE account (the org/project/bot when
|
|
69
69
|
// switched, else the personal user).
|
|
70
|
-
const { oxyServices,
|
|
70
|
+
const { oxyServices, user } = useOxy();
|
|
71
71
|
const { t, locale } = useI18n();
|
|
72
72
|
const bloomTheme = useTheme();
|
|
73
73
|
const [isLoading, setIsLoading] = useState(true);
|
|
@@ -79,8 +79,8 @@ const PrivacySettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
79
79
|
const { values: settings, toggle, savingKeys, setValues } = useSettingToggles<PrivacySettings>({
|
|
80
80
|
initialValues: DEFAULT_PRIVACY_SETTINGS,
|
|
81
81
|
onSave: async (key, value) => {
|
|
82
|
-
if (!
|
|
83
|
-
await oxyServices.updatePrivacySettings({ [key]: value },
|
|
82
|
+
if (!user?.id || !oxyServices) return;
|
|
83
|
+
await oxyServices.updatePrivacySettings({ [key]: value }, user.id);
|
|
84
84
|
},
|
|
85
85
|
errorMessage: t('privacySettings.updateError') || 'Failed to update privacy setting',
|
|
86
86
|
});
|
|
@@ -92,8 +92,8 @@ const PrivacySettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
92
92
|
const loadSettings = async () => {
|
|
93
93
|
try {
|
|
94
94
|
setIsLoading(true);
|
|
95
|
-
if (
|
|
96
|
-
const privacySettings = await oxyServices.getPrivacySettings(
|
|
95
|
+
if (user?.id && oxyServices) {
|
|
96
|
+
const privacySettings = await oxyServices.getPrivacySettings(user.id);
|
|
97
97
|
if (privacySettings) {
|
|
98
98
|
setValues(privacySettings);
|
|
99
99
|
}
|
|
@@ -109,7 +109,7 @@ const PrivacySettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
loadSettings();
|
|
112
|
-
}, [
|
|
112
|
+
}, [user?.id, oxyServices, t, setValues]);
|
|
113
113
|
|
|
114
114
|
// Load blocked and restricted users
|
|
115
115
|
useEffect(() => {
|
|
@@ -134,9 +134,9 @@ const PrivacySettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
134
134
|
|
|
135
135
|
loadUsers();
|
|
136
136
|
// Re-load when the active account changes so the block/restrict lists
|
|
137
|
-
// reflect the account currently switched into (they resolve
|
|
138
|
-
//
|
|
139
|
-
}, [oxyServices,
|
|
137
|
+
// reflect the account currently switched into (they resolve from the
|
|
138
|
+
// active session, which IS that account).
|
|
139
|
+
}, [oxyServices, user?.id]);
|
|
140
140
|
|
|
141
141
|
const handleUnblock = useCallback(async (userId: string) => {
|
|
142
142
|
if (!oxyServices) return;
|
|
@@ -31,7 +31,7 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
31
31
|
// and the own-profile fallback is the ACTIVE account (the account switched
|
|
32
32
|
// into), so previewing my profile while switched into an org/project/bot
|
|
33
33
|
// resolves "this is mine" against that account, not the session owner.
|
|
34
|
-
const { oxyServices,
|
|
34
|
+
const { oxyServices, user: currentUser } = useOxy();
|
|
35
35
|
const [profile, setProfile] = useState<User | null>(null);
|
|
36
36
|
const [reputationTotal, setReputationTotal] = useState<number | null>(null);
|
|
37
37
|
const [postsCount, setPostsCount] = useState<number | null>(null);
|
|
@@ -40,7 +40,7 @@ const SavesCollectionsScreen: React.FC<BaseScreenProps> = ({
|
|
|
40
40
|
}) => {
|
|
41
41
|
// Saves & collections belong to the ACTIVE account (the org/project/bot when
|
|
42
42
|
// switched, else the personal user).
|
|
43
|
-
const { oxyServices,
|
|
43
|
+
const { oxyServices, user } = useOxy();
|
|
44
44
|
const { t } = useI18n();
|
|
45
45
|
const bloomTheme = useTheme();
|
|
46
46
|
const [savedItems, setSavedItems] = useState<SavedItem[]>([]);
|
|
@@ -53,10 +53,10 @@ const SavesCollectionsScreen: React.FC<BaseScreenProps> = ({
|
|
|
53
53
|
const loadData = async () => {
|
|
54
54
|
try {
|
|
55
55
|
setIsLoading(true);
|
|
56
|
-
if (
|
|
56
|
+
if (user?.id && oxyServices) {
|
|
57
57
|
const [saved, cols] = await Promise.all([
|
|
58
|
-
oxyServices.getSavedItems(
|
|
59
|
-
oxyServices.getCollections(
|
|
58
|
+
oxyServices.getSavedItems(user.id),
|
|
59
|
+
oxyServices.getCollections(user.id),
|
|
60
60
|
]);
|
|
61
61
|
setSavedItems(saved.map((item) => ({
|
|
62
62
|
id: item.id,
|
|
@@ -80,7 +80,7 @@ const SavesCollectionsScreen: React.FC<BaseScreenProps> = ({
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
loadData();
|
|
83
|
-
}, [
|
|
83
|
+
}, [user?.id, oxyServices, t]);
|
|
84
84
|
|
|
85
85
|
const formatDate = (date: Date) => {
|
|
86
86
|
return date.toLocaleDateString();
|
|
@@ -22,9 +22,9 @@ const SearchSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
22
22
|
goBack,
|
|
23
23
|
}) => {
|
|
24
24
|
// Search settings are persisted on the ACTIVE account's profile (the
|
|
25
|
-
// org/project/bot when switched, else the personal user);
|
|
26
|
-
//
|
|
27
|
-
const { oxyServices,
|
|
25
|
+
// org/project/bot when switched, else the personal user); reads/writes
|
|
26
|
+
// authenticate as the active session, which IS that account.
|
|
27
|
+
const { oxyServices, user } = useOxy();
|
|
28
28
|
const { t } = useI18n();
|
|
29
29
|
const bloomTheme = useTheme();
|
|
30
30
|
const [isLoading, setIsLoading] = useState(true);
|
|
@@ -33,7 +33,7 @@ const SearchSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
33
33
|
const { values: settings, toggle, savingKeys, setValues } = useSettingToggles<SearchSettings>({
|
|
34
34
|
initialValues: { safeSearch: false, searchPersonalization: true },
|
|
35
35
|
onSave: async (key, value) => {
|
|
36
|
-
if (!
|
|
36
|
+
if (!user?.id || !oxyServices) return;
|
|
37
37
|
|
|
38
38
|
const fieldMap: Record<keyof SearchSettings, string> = {
|
|
39
39
|
safeSearch: 'autoFilter',
|
|
@@ -56,7 +56,7 @@ const SearchSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
56
56
|
const loadSettings = async () => {
|
|
57
57
|
try {
|
|
58
58
|
setIsLoading(true);
|
|
59
|
-
if (
|
|
59
|
+
if (user?.id && oxyServices) {
|
|
60
60
|
const userData = await oxyServices.getCurrentUser() as User & { privacySettings?: { autoFilter?: boolean; dataSharing?: boolean } };
|
|
61
61
|
const privacySettings = userData?.privacySettings || {};
|
|
62
62
|
|
|
@@ -75,7 +75,7 @@ const SearchSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
loadSettings();
|
|
78
|
-
}, [
|
|
78
|
+
}, [user?.id, oxyServices, setValues]);
|
|
79
79
|
|
|
80
80
|
if (isLoading) {
|
|
81
81
|
return (
|
|
@@ -65,12 +65,12 @@ const WelcomeNewUserScreen: React.FC<BaseScreenProps & { newUser?: any }> = ({
|
|
|
65
65
|
}) => {
|
|
66
66
|
// Use useOxy() hook for OxyContext values. The greeting/avatar identity is
|
|
67
67
|
// the ACTIVE account (the personal user during onboarding, but read through
|
|
68
|
-
// `
|
|
68
|
+
// `user` so this stays correct everywhere), with the freshly
|
|
69
69
|
// registered `newUser` as the pre-store-hydration fallback.
|
|
70
|
-
const {
|
|
70
|
+
const { user, oxyServices } = useOxy();
|
|
71
71
|
const { t, locale } = useI18n();
|
|
72
72
|
const updateProfileMutation = useUpdateProfile();
|
|
73
|
-
const currentUser =
|
|
73
|
+
const currentUser = user || newUser; // fallback
|
|
74
74
|
const bloomTheme = useTheme();
|
|
75
75
|
const colors = {
|
|
76
76
|
primary: bloomTheme.colors.primary,
|
|
@@ -93,12 +93,12 @@ const WelcomeNewUserScreen: React.FC<BaseScreenProps & { newUser?: any }> = ({
|
|
|
93
93
|
|
|
94
94
|
// Update selectedAvatarId when the active account's avatar changes
|
|
95
95
|
useEffect(() => {
|
|
96
|
-
if (
|
|
97
|
-
setSelectedAvatarId(
|
|
96
|
+
if (user?.avatar) {
|
|
97
|
+
setSelectedAvatarId(user.avatar);
|
|
98
98
|
} else if (newUser?.avatar) {
|
|
99
99
|
setSelectedAvatarId(newUser.avatar);
|
|
100
100
|
}
|
|
101
|
-
}, [
|
|
101
|
+
}, [user?.avatar, newUser?.avatar]);
|
|
102
102
|
|
|
103
103
|
const avatarUri = selectedAvatarId ? oxyServices.getFileDownloadUrl(selectedAvatarId, 'thumb') : undefined;
|
|
104
104
|
|