From f146f6a3120be1801ec0d6083cf45c3a6399f5ae Mon Sep 17 00:00:00 2001 From: tapframe Date: Thu, 9 Oct 2025 11:12:49 +0530 Subject: [PATCH] update aimodel --- src/screens/SettingsScreen.tsx | 38 ++-------------------------------- src/services/aiService.ts | 2 +- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/screens/SettingsScreen.tsx b/src/screens/SettingsScreen.tsx index 92dff76d..81542964 100644 --- a/src/screens/SettingsScreen.tsx +++ b/src/screens/SettingsScreen.tsx @@ -26,13 +26,11 @@ import { stremioService } from '../services/stremioService'; import { useCatalogContext } from '../contexts/CatalogContext'; import { useTraktContext } from '../contexts/TraktContext'; import { useTheme } from '../contexts/ThemeContext'; -import { useAccount } from '../contexts/AccountContext'; import { catalogService } from '../services/catalogService'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import * as Sentry from '@sentry/react-native'; import { getDisplayedAppVersion } from '../utils/version'; import CustomAlert from '../components/CustomAlert'; -import ProfileIcon from '../components/icons/ProfileIcon'; import PluginIcon from '../components/icons/PluginIcon'; import TraktIcon from '../components/icons/TraktIcon'; @@ -275,7 +273,6 @@ const SettingsScreen: React.FC = () => { const { isAuthenticated, userProfile, refreshAuthStatus } = useTraktContext(); const { currentTheme } = useTheme(); const insets = useSafeAreaInsets(); - const { user, signOut, loading: accountLoading, refreshCurrentUser } = useAccount(); // Tablet-specific state const [selectedCategory, setSelectedCategory] = useState('account'); @@ -289,7 +286,7 @@ const SettingsScreen: React.FC = () => { const [openRouterKeySet, setOpenRouterKeySet] = useState(false); const [initialLoadComplete, setInitialLoadComplete] = useState(false); - // Add a useEffect to check authentication status on focus + // Add a useEffect to check Trakt authentication status on focus useEffect(() => { // This will reload the Trakt auth status whenever the settings screen is focused const unsubscribe = navigation.addListener('focus', () => { @@ -301,15 +298,10 @@ const SettingsScreen: React.FC = () => { if (__DEV__) console.log('SettingsScreen focused, refreshing auth status. Current state:', { isAuthenticated, userProfile: userProfile?.username }); } refreshAuthStatus(); - // Don't refresh account user on every focus - the context handles auth state changes - // Only refresh if we have no user at all and aren't loading (rare edge case) - if (!user && !accountLoading && !initialLoadComplete) { - refreshCurrentUser(); - } }); return unsubscribe; - }, [navigation, isAuthenticated, userProfile, refreshAuthStatus, refreshCurrentUser, user, accountLoading, initialLoadComplete]); + }, [navigation, isAuthenticated, userProfile, refreshAuthStatus]); const loadData = useCallback(async () => { try { @@ -440,32 +432,6 @@ const SettingsScreen: React.FC = () => { case 'account': return ( - {!accountLoading && user ? ( - <> - } - onPress={() => navigation.navigate('AccountManage')} - isTablet={isTablet} - /> - - ) : !accountLoading && !user ? ( - navigation.navigate('Account')} - isTablet={isTablet} - /> - ) : ( - - )}