From 7cb2f203b13a4859a6fb1b4464d430441696a5af Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Tue, 2 Dec 2025 00:23:13 -0500 Subject: [PATCH] refine platform check for native functionality in AccountSettings and Settings components --- src/views/Settings/AccountSettings.jsx | 15 +++++++++------ src/views/Settings/Settings.jsx | 5 ++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/views/Settings/AccountSettings.jsx b/src/views/Settings/AccountSettings.jsx index ffaa904..161c394 100644 --- a/src/views/Settings/AccountSettings.jsx +++ b/src/views/Settings/AccountSettings.jsx @@ -1,5 +1,5 @@ import { Capacitor } from '@capacitor/core' -import { Box, Button, Container, Divider, Typography } from '@mui/joy' +import { Box, Button, Typography } from '@mui/joy' import { Purchases } from '@revenuecat/purchases-capacitor' import { useQueryClient } from '@tanstack/react-query' import moment from 'moment' @@ -48,7 +48,7 @@ const AccountSettings = () => { return `You are currently on the Free plan. Upgrade to the Plus plan to unlock more features.` } } - + const getSubscriptionStatus = () => { if (userProfile?.subscription === 'active') { return `Plus` @@ -66,14 +66,14 @@ const AccountSettings = () => { if (!userProfile) { return ( - +
Loading...
) } return ( - +
Change your account settings, type or update your password @@ -94,7 +94,10 @@ const AccountSettings = () => { userProfile?.subscription !== 'cancelled') } onClick={async () => { - if (Capacitor.isNativePlatform()) { + if ( + Capacitor.isNativePlatform() && + Capacitor.getPlatform() === 'ios' + ) { try { const { RevenueCatUI } = await import( '@revenuecat/purchases-capacitor-ui' @@ -305,4 +308,4 @@ const AccountSettings = () => { ) } -export default AccountSettings \ No newline at end of file +export default AccountSettings diff --git a/src/views/Settings/Settings.jsx b/src/views/Settings/Settings.jsx index fa55d36..9d5c064 100644 --- a/src/views/Settings/Settings.jsx +++ b/src/views/Settings/Settings.jsx @@ -712,7 +712,10 @@ const Settings = () => { userProfile?.subscription !== 'cancelled') } onClick={async () => { - if (Capacitor.isNativePlatform()) { + if ( + Capacitor.isNativePlatform() && + Capacitor.getPlatform() === 'ios' + ) { try { const { RevenueCatUI } = await import( '@revenuecat/purchases-capacitor-ui'