update beta 10

This commit is contained in:
tapframe 2025-09-08 02:32:28 +05:30
parent 950e38a20b
commit 28752791ae
6 changed files with 43 additions and 56 deletions

View file

@ -40,10 +40,10 @@ Sentry.init({
// For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/ // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
sendDefaultPii: true, sendDefaultPii: true,
// Configure Session Replay (disabled for performance) // Configure Session Replay
replaysSessionSampleRate: 0, replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 0, replaysOnErrorSampleRate: 1,
integrations: [Sentry.feedbackIntegration()], integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()],
// uncomment the line below to enable Spotlight (https://spotlightjs.com) // uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: __DEV__, // spotlight: __DEV__,

@ -1 +1 @@
Subproject commit 6fda05ee03e39bd6bd1ee9d15be00cb33b491574 Subproject commit 5c3e2d8bccf7d076e392fdc397233f392e2a1563

View file

@ -41,7 +41,6 @@ const { width, height } = Dimensions.get('window');
const isTablet = width >= 768; const isTablet = width >= 768;
// Ultra-optimized animation constants // Ultra-optimized animation constants
const PARALLAX_FACTOR = 0.3;
const SCALE_FACTOR = 1.02; const SCALE_FACTOR = 1.02;
const FADE_THRESHOLD = 200; const FADE_THRESHOLD = 200;
@ -933,13 +932,11 @@ const HeroSection: React.FC<HeroSectionProps> = memo(({
// Enhanced backdrop with smooth loading animation // Enhanced backdrop with smooth loading animation
const backdropImageStyle = useAnimatedStyle(() => { const backdropImageStyle = useAnimatedStyle(() => {
'worklet'; 'worklet';
const translateY = scrollY.value * PARALLAX_FACTOR;
const scale = 1 + (scrollY.value * 0.0001); // Micro scale effect const scale = 1 + (scrollY.value * 0.0001); // Micro scale effect
return { return {
opacity: imageOpacity.value * imageLoadOpacity.value, opacity: imageOpacity.value * imageLoadOpacity.value,
transform: [ transform: [
{ translateY: -Math.min(translateY, 100) }, // Cap translation
{ scale: Math.min(scale, SCALE_FACTOR) } // Cap scale { scale: Math.min(scale, SCALE_FACTOR) } // Cap scale
], ],
}; };

View file

@ -900,9 +900,17 @@ const PluginsScreen: React.FC = () => {
const repo = repositories.find(r => r.id === repoId); const repo = repositories.find(r => r.id === repoId);
if (!repo) return; if (!repo) return;
// Special handling for the last repository
const isLastRepository = repositories.length === 1;
const alertTitle = isLastRepository ? 'Remove Last Repository' : 'Remove Repository';
const alertMessage = isLastRepository
? `Are you sure you want to remove "${repo.name}"? This is your only repository, so you'll have no scrapers available until you add a new repository.`
: `Are you sure you want to remove "${repo.name}"? This will also remove all scrapers from this repository.`;
Alert.alert( Alert.alert(
'Remove Repository', alertTitle,
`Are you sure you want to remove "${repo.name}"? This will also remove all scrapers from this repository.`, alertMessage,
[ [
{ text: 'Cancel', style: 'cancel' }, { text: 'Cancel', style: 'cancel' },
{ {
@ -913,7 +921,10 @@ const PluginsScreen: React.FC = () => {
await localScraperService.removeRepository(repoId); await localScraperService.removeRepository(repoId);
await loadRepositories(); await loadRepositories();
await loadScrapers(); await loadScrapers();
Alert.alert('Success', 'Repository removed successfully'); const successMessage = isLastRepository
? 'Repository removed successfully. You can add a new repository using the "Add Repository" button.'
: 'Repository removed successfully';
Alert.alert('Success', successMessage);
} catch (error) { } catch (error) {
logger.error('[ScraperSettings] Failed to remove repository:', error); logger.error('[ScraperSettings] Failed to remove repository:', error);
Alert.alert('Error', error instanceof Error ? error.message : 'Failed to remove repository'); Alert.alert('Error', error instanceof Error ? error.message : 'Failed to remove repository');
@ -1312,15 +1323,13 @@ const PluginsScreen: React.FC = () => {
<Text style={styles.repositoryActionButtonText}>Refresh</Text> <Text style={styles.repositoryActionButtonText}>Refresh</Text>
)} )}
</TouchableOpacity> </TouchableOpacity>
{repositories.length > 1 && ( <TouchableOpacity
<TouchableOpacity style={[styles.repositoryActionButton, styles.repositoryActionButtonDanger]}
style={[styles.repositoryActionButton, styles.repositoryActionButtonDanger]} onPress={() => handleRemoveRepository(repo.id)}
onPress={() => handleRemoveRepository(repo.id)} disabled={switchingRepository !== null}
disabled={switchingRepository !== null} >
> <Text style={styles.repositoryActionButtonText}>Remove</Text>
<Text style={styles.repositoryActionButtonText}>Remove</Text> </TouchableOpacity>
</TouchableOpacity>
)}
</View> </View>
</View> </View>
))} ))}

View file

@ -415,16 +415,18 @@ class LocalScraperService {
throw new Error(`Repository with id ${id} not found`); throw new Error(`Repository with id ${id} not found`);
} }
// Don't allow removing the last repository // Allow removing the last repository - users can add new ones
if (this.repositories.size <= 1) { // The app will work without repositories (no scrapers available)
throw new Error('Cannot remove the last repository');
}
// If removing current repository, switch to another one // If removing current repository, switch to another one or clear current
if (id === this.currentRepositoryId) { if (id === this.currentRepositoryId) {
const remainingRepos = Array.from(this.repositories.values()).filter(r => r.id !== id); const remainingRepos = Array.from(this.repositories.values()).filter(r => r.id !== id);
if (remainingRepos.length > 0) { if (remainingRepos.length > 0) {
await this.setCurrentRepository(remainingRepos[0].id); await this.setCurrentRepository(remainingRepos[0].id);
} else {
// No repositories left, clear current repository
this.currentRepositoryId = '';
await AsyncStorage.removeItem('current-repository-id');
} }
} }

View file

@ -11,7 +11,7 @@ export interface UpdateInfo {
export class UpdateService { export class UpdateService {
private static instance: UpdateService; private static instance: UpdateService;
private updateCheckInterval: NodeJS.Timeout | null = null; private updateCheckInterval: NodeJS.Timeout | null = null;
private readonly CHECK_INTERVAL = 5 * 60 * 1000; // 5 minutes // Removed automatic periodic checks - only check on app start and manual trigger
private logs: string[] = []; private logs: string[] = [];
private readonly MAX_LOGS = 100; // Keep last 100 logs private readonly MAX_LOGS = 100; // Keep last 100 logs
@ -233,10 +233,7 @@ export class UpdateService {
return; return;
} }
this.addLog('Updates are enabled, setting up periodic checks', 'INFO'); this.addLog('Updates are enabled, skipping automatic periodic checks', 'INFO');
// Set up periodic update checks
this.startPeriodicUpdateChecks();
this.addLog('UpdateService initialization completed successfully', 'INFO'); this.addLog('UpdateService initialization completed successfully', 'INFO');
} catch (error) { } catch (error) {
this.addLog(`Initialization failed: ${error instanceof Error ? error.message : String(error)}`, 'ERROR'); this.addLog(`Initialization failed: ${error instanceof Error ? error.message : String(error)}`, 'ERROR');
@ -408,39 +405,21 @@ export class UpdateService {
} }
/** /**
* Start periodic update checks * Start periodic update checks - DISABLED
* Updates are now only checked on app start and manual trigger
*/ */
private startPeriodicUpdateChecks(): void { private startPeriodicUpdateChecks(): void {
if (this.updateCheckInterval) { this.addLog('Periodic update checks are disabled - only checking on app start and manual trigger', 'INFO');
this.addLog('Stopping existing periodic update checks', 'INFO'); // Method kept for compatibility but no longer starts automatic checks
clearInterval(this.updateCheckInterval);
}
this.addLog(`Starting periodic update checks every ${this.CHECK_INTERVAL / 1000} seconds`, 'INFO');
this.updateCheckInterval = setInterval(async () => {
try {
this.addLog('Performing scheduled update check...', 'INFO');
await this.checkForUpdates();
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
this.addLog(`Scheduled update check failed: ${errorMessage}`, 'ERROR');
console.error('Periodic update check failed:', error);
}
}, this.CHECK_INTERVAL);
} }
/** /**
* Stop periodic update checks * Stop periodic update checks - DISABLED
* No periodic checks are running, so this is a no-op
*/ */
public stopPeriodicUpdateChecks(): void { public stopPeriodicUpdateChecks(): void {
if (this.updateCheckInterval) { this.addLog('Periodic update checks are disabled - nothing to stop', 'INFO');
this.addLog('Stopping periodic update checks', 'INFO'); // Method kept for compatibility but no longer stops automatic checks
clearInterval(this.updateCheckInterval);
this.updateCheckInterval = null;
} else {
this.addLog('No periodic update checks running to stop', 'INFO');
}
} }
/** /**