mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:39:37 -05:00 
			
		
		
		
	fix(mobile): background backup not working in release mode (#664)
This commit is contained in:
		
							parent
							
								
									cc4881d633
								
							
						
					
					
						commit
						f88ff4fb5c
					
				@ -173,7 +173,8 @@ class BackgroundService {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    } catch (error) {
 | 
					    } catch (error) {
 | 
				
			||||||
      debugPrint(
 | 
					      debugPrint(
 | 
				
			||||||
          "[_clearErrorNotifications] failed to communicate with plugin");
 | 
					        "[_clearErrorNotifications] failed to communicate with plugin",
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -344,7 +345,9 @@ class BackgroundService {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Future<bool> _runBackup(
 | 
					  Future<bool> _runBackup(
 | 
				
			||||||
      BackupService backupService, HiveBackupAlbums backupAlbumInfo) async {
 | 
					    BackupService backupService,
 | 
				
			||||||
 | 
					    HiveBackupAlbums backupAlbumInfo,
 | 
				
			||||||
 | 
					  ) async {
 | 
				
			||||||
    _errorGracePeriodExceeded = _isErrorGracePeriodExceeded();
 | 
					    _errorGracePeriodExceeded = _isErrorGracePeriodExceeded();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (_canceledBySystem) {
 | 
					    if (_canceledBySystem) {
 | 
				
			||||||
@ -445,6 +448,7 @@ class BackgroundService {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// entry point called by Kotlin/Java code; needs to be a top-level function
 | 
					/// entry point called by Kotlin/Java code; needs to be a top-level function
 | 
				
			||||||
 | 
					@pragma('vm:entry-point')
 | 
				
			||||||
void _nativeEntry() {
 | 
					void _nativeEntry() {
 | 
				
			||||||
  WidgetsFlutterBinding.ensureInitialized();
 | 
					  WidgetsFlutterBinding.ensureInitialized();
 | 
				
			||||||
  BackgroundService backgroundService = BackgroundService();
 | 
					  BackgroundService backgroundService = BackgroundService();
 | 
				
			||||||
 | 
				
			|||||||
@ -173,19 +173,19 @@ class BackupControllerPage extends HookConsumerWidget {
 | 
				
			|||||||
              ).tr(),
 | 
					              ).tr(),
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
            actions: [
 | 
					            actions: [
 | 
				
			||||||
              TextButton(
 | 
					              OutlinedButton(
 | 
				
			||||||
                onPressed: () => launchUrl(
 | 
					                onPressed: () => launchUrl(
 | 
				
			||||||
                  Uri.parse('https://dontkillmyapp.com'),
 | 
					                  Uri.parse('https://dontkillmyapp.com'),
 | 
				
			||||||
                    mode: LaunchMode.externalApplication),
 | 
					                  mode: LaunchMode.externalApplication,
 | 
				
			||||||
                child: Text(
 | 
					                ),
 | 
				
			||||||
 | 
					                child: const Text(
 | 
				
			||||||
                  "backup_controller_page_background_battery_info_link",
 | 
					                  "backup_controller_page_background_battery_info_link",
 | 
				
			||||||
                  style: TextStyle(color: buttonTextColor),
 | 
					 | 
				
			||||||
                ).tr(),
 | 
					                ).tr(),
 | 
				
			||||||
              ),
 | 
					              ),
 | 
				
			||||||
              TextButton(
 | 
					              ElevatedButton(
 | 
				
			||||||
                child: Text(
 | 
					                child: const Text(
 | 
				
			||||||
                  'backup_controller_page_background_battery_info_ok',
 | 
					                  'backup_controller_page_background_battery_info_ok',
 | 
				
			||||||
                  style: TextStyle(color: buttonTextColor),
 | 
					                  style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12),
 | 
				
			||||||
                ).tr(),
 | 
					                ).tr(),
 | 
				
			||||||
                onPressed: () {
 | 
					                onPressed: () {
 | 
				
			||||||
                  Navigator.of(context).pop();
 | 
					                  Navigator.of(context).pop();
 | 
				
			||||||
@ -636,8 +636,8 @@ class BackupControllerPage extends HookConsumerWidget {
 | 
				
			|||||||
                    backupState.backupProgress == BackUpProgressEnum.inProgress
 | 
					                    backupState.backupProgress == BackUpProgressEnum.inProgress
 | 
				
			||||||
                        ? ElevatedButton(
 | 
					                        ? ElevatedButton(
 | 
				
			||||||
                            style: ElevatedButton.styleFrom(
 | 
					                            style: ElevatedButton.styleFrom(
 | 
				
			||||||
                              primary: Colors.red[300],
 | 
					                              foregroundColor: Colors.grey[50],
 | 
				
			||||||
                              onPrimary: Colors.grey[50],
 | 
					                              backgroundColor: Colors.red[300],
 | 
				
			||||||
                              // padding: const EdgeInsets.all(14),
 | 
					                              // padding: const EdgeInsets.all(14),
 | 
				
			||||||
                            ),
 | 
					                            ),
 | 
				
			||||||
                            onPressed: () {
 | 
					                            onPressed: () {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user