mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-11 04:21:42 +00:00
update popup for android fix
This commit is contained in:
parent
4daab74e27
commit
b81435be29
6 changed files with 42 additions and 43 deletions
24
App.tsx
24
App.tsx
|
|
@ -107,10 +107,8 @@ const ThemedApp = () => {
|
||||||
const onboardingCompleted = await AsyncStorage.getItem('hasCompletedOnboarding');
|
const onboardingCompleted = await AsyncStorage.getItem('hasCompletedOnboarding');
|
||||||
setHasCompletedOnboarding(onboardingCompleted === 'true');
|
setHasCompletedOnboarding(onboardingCompleted === 'true');
|
||||||
|
|
||||||
// Initialize update service (skip on Android to prevent update checks)
|
// Initialize update service
|
||||||
if (Platform.OS !== 'android') {
|
await UpdateService.initialize();
|
||||||
await UpdateService.initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize memory monitoring service to prevent OutOfMemoryError
|
// Initialize memory monitoring service to prevent OutOfMemoryError
|
||||||
memoryMonitorService; // Just accessing it starts the monitoring
|
memoryMonitorService; // Just accessing it starts the monitoring
|
||||||
|
|
@ -170,16 +168,14 @@ const ThemedApp = () => {
|
||||||
<StatusBar style="light" />
|
<StatusBar style="light" />
|
||||||
{!isAppReady && <SplashScreen onFinish={handleSplashComplete} />}
|
{!isAppReady && <SplashScreen onFinish={handleSplashComplete} />}
|
||||||
{shouldShowApp && <AppNavigator initialRouteName={initialRouteName} />}
|
{shouldShowApp && <AppNavigator initialRouteName={initialRouteName} />}
|
||||||
{Platform.OS === 'ios' && (
|
<UpdatePopup
|
||||||
<UpdatePopup
|
visible={showUpdatePopup}
|
||||||
visible={showUpdatePopup}
|
updateInfo={updateInfo}
|
||||||
updateInfo={updateInfo}
|
onUpdateNow={handleUpdateNow}
|
||||||
onUpdateNow={handleUpdateNow}
|
onUpdateLater={handleUpdateLater}
|
||||||
onUpdateLater={handleUpdateLater}
|
onDismiss={handleDismiss}
|
||||||
onDismiss={handleDismiss}
|
isInstalling={isInstalling}
|
||||||
isInstalling={isInstalling}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<MajorUpdateOverlay
|
<MajorUpdateOverlay
|
||||||
visible={githubUpdate.visible}
|
visible={githubUpdate.visible}
|
||||||
latestTag={githubUpdate.latestTag}
|
latestTag={githubUpdate.latestTag}
|
||||||
|
|
|
||||||
|
|
@ -79,11 +79,6 @@ const UpdatePopup: React.FC<UpdatePopupProps> = ({
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Completely disable popup on Android
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// iOS implementation with full features
|
// iOS implementation with full features
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,6 @@ export const useUpdatePopup = (): UseUpdatePopupReturn => {
|
||||||
|
|
||||||
const checkForUpdates = useCallback(async (forceCheck = false) => {
|
const checkForUpdates = useCallback(async (forceCheck = false) => {
|
||||||
try {
|
try {
|
||||||
// Skip update checks on Android to prevent OTA checks
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if user has dismissed the popup for this version
|
// Check if user has dismissed the popup for this version
|
||||||
const dismissedVersion = await AsyncStorage.getItem(UPDATE_POPUP_STORAGE_KEY);
|
const dismissedVersion = await AsyncStorage.getItem(UPDATE_POPUP_STORAGE_KEY);
|
||||||
|
|
@ -119,10 +115,6 @@ export const useUpdatePopup = (): UseUpdatePopupReturn => {
|
||||||
|
|
||||||
// Handle startup update check results
|
// Handle startup update check results
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Skip startup update check registration on Android
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleStartupUpdateCheck = (updateInfo: UpdateInfo) => {
|
const handleStartupUpdateCheck = (updateInfo: UpdateInfo) => {
|
||||||
console.log('UpdatePopup: Received startup update check result', updateInfo);
|
console.log('UpdatePopup: Received startup update check result', updateInfo);
|
||||||
|
|
@ -130,16 +122,7 @@ export const useUpdatePopup = (): UseUpdatePopupReturn => {
|
||||||
setHasCheckedOnStartup(true);
|
setHasCheckedOnStartup(true);
|
||||||
|
|
||||||
if (updateInfo.isAvailable) {
|
if (updateInfo.isAvailable) {
|
||||||
if (Platform.OS === 'android') {
|
setShowUpdatePopup(true);
|
||||||
// Set badge and show a toast
|
|
||||||
(async () => {
|
|
||||||
try { await AsyncStorage.setItem(UPDATE_BADGE_KEY, 'true'); } catch {}
|
|
||||||
})();
|
|
||||||
toastService.showInfo('Update Available', 'Update available — go to Settings → App Updates');
|
|
||||||
setShowUpdatePopup(false);
|
|
||||||
} else {
|
|
||||||
setShowUpdatePopup(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -187,10 +170,6 @@ export const useUpdatePopup = (): UseUpdatePopupReturn => {
|
||||||
return; // Already checked on startup
|
return; // Already checked on startup
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip auto-check on Android to prevent OTA checks
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add a small delay to ensure the app is fully loaded
|
// Add a small delay to ensure the app is fully loaded
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ const HomeScreen = () => {
|
||||||
await AsyncStorage.removeItem('showLoginHintToastOnce');
|
await AsyncStorage.removeItem('showLoginHintToastOnce');
|
||||||
hideTimer = setTimeout(() => setHintVisible(false), 2000);
|
hideTimer = setTimeout(() => setHintVisible(false), 2000);
|
||||||
// Also show a global toast for consistency across screens
|
// Also show a global toast for consistency across screens
|
||||||
showInfo('Sign In Available', 'You can sign in anytime from Settings → Account');
|
// showInfo('Sign In Available', 'You can sign in anytime from Settings → Account');
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -864,16 +864,31 @@ class LocalScraperService {
|
||||||
async getStreams(type: string, tmdbId: string, season?: number, episode?: number, callback?: ScraperCallback): Promise<void> {
|
async getStreams(type: string, tmdbId: string, season?: number, episode?: number, callback?: ScraperCallback): Promise<void> {
|
||||||
await this.ensureInitialized();
|
await this.ensureInitialized();
|
||||||
|
|
||||||
|
// Get list of installed scrapers at the beginning for callback invocations
|
||||||
|
const installedScrapers = Array.from(this.installedScrapers.values());
|
||||||
|
|
||||||
|
// Helper function to invoke callback for all installed scrapers with empty results
|
||||||
|
const invokeCallbacksForAllScrapers = (reason: string) => {
|
||||||
|
if (callback && installedScrapers.length > 0) {
|
||||||
|
logger.log(`[LocalScraperService] Invoking callbacks for ${installedScrapers.length} scrapers due to: ${reason}`);
|
||||||
|
installedScrapers.forEach(scraper => {
|
||||||
|
callback([], scraper.id, scraper.name, null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Check if local scrapers are enabled
|
// Check if local scrapers are enabled
|
||||||
const userSettings = await this.getUserScraperSettings();
|
const userSettings = await this.getUserScraperSettings();
|
||||||
if (!userSettings.enableLocalScrapers) {
|
if (!userSettings.enableLocalScrapers) {
|
||||||
logger.log('[LocalScraperService] Local scrapers are disabled');
|
logger.log('[LocalScraperService] Local scrapers are disabled');
|
||||||
|
invokeCallbacksForAllScrapers('local scrapers disabled');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no repository is configured, return early
|
// If no repository is configured, return early
|
||||||
if (!this.repositoryUrl) {
|
if (!this.repositoryUrl) {
|
||||||
logger.log('[LocalScraperService] No repository URL configured');
|
logger.log('[LocalScraperService] No repository URL configured');
|
||||||
|
invokeCallbacksForAllScrapers('no repository URL configured');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -884,6 +899,7 @@ class LocalScraperService {
|
||||||
await this.performRepositoryRefresh();
|
await this.performRepositoryRefresh();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('[LocalScraperService] Failed to refresh repository for getStreams:', error);
|
logger.error('[LocalScraperService] Failed to refresh repository for getStreams:', error);
|
||||||
|
invokeCallbacksForAllScrapers('repository refresh failed');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -899,6 +915,7 @@ class LocalScraperService {
|
||||||
|
|
||||||
if (enabledScrapers.length === 0) {
|
if (enabledScrapers.length === 0) {
|
||||||
logger.log('[LocalScraperService] No enabled scrapers found for type:', type);
|
logger.log('[LocalScraperService] No enabled scrapers found for type:', type);
|
||||||
|
// No callback needed here since this is after filtering - scrapers weren't added to UI yet
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1171,7 +1171,19 @@ class StremioService {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logger.log('🔧 [getStreams] Local scrapers not executed for this ID/type; continuing with Stremio addons');
|
logger.log('🔧 [getStreams] Local scrapers not executed - no TMDB ID available');
|
||||||
|
// Notify UI that local scrapers won't execute by calling their callbacks
|
||||||
|
try {
|
||||||
|
const installedScrapers = await localScraperService.getInstalledScrapers();
|
||||||
|
const enabledScrapers = installedScrapers.filter(s => s.enabled);
|
||||||
|
enabledScrapers.forEach(scraper => {
|
||||||
|
if (callback) {
|
||||||
|
callback([], scraper.id, scraper.name, null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
logger.warn('🔧 [getStreams] Failed to notify UI about skipped local scrapers:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue