mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Confirm exit for migrations
(cherry picked from commit 640bd8d9babb3ace1d6a370adad35050271aa008)
This commit is contained in:
		| @@ -130,6 +130,13 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle), | ||||
|             sourceManager.get(value) as? CatalogueSource } | ||||
|         if (config == null) return | ||||
|         for (manga in mangas) { | ||||
|             if (migrationsJob?.isCancelled == true) { | ||||
|                 break | ||||
|             } | ||||
|             // in case it was removed | ||||
|             if (manga.mangaId !in config.mangaIds) { | ||||
|                 continue | ||||
|             } | ||||
|             if (!manga.searchResult.initialized && manga.migrationJob.isActive) { | ||||
|                 val mangaObj = manga.manga() | ||||
|  | ||||
| @@ -246,7 +253,9 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle), | ||||
|  | ||||
|     override fun updateCount() { | ||||
|         launchUI { | ||||
|             setTitle() | ||||
|             if (router.backstack.last().controller() == this@MigrationListController) { | ||||
|                 setTitle() | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @@ -370,6 +379,24 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle), | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     override fun handleBack(): Boolean { | ||||
|         activity?.let { | ||||
|             MaterialDialog.Builder(it).title(R.string.stop_migration) | ||||
|                 .positiveText(R.string.yes) | ||||
|                 .negativeText(R.string.no) | ||||
|                 .onPositive { _, _ -> | ||||
|                     router.popCurrentController() | ||||
|                     migrationsJob?.cancel() | ||||
|                 } | ||||
|                 .show() | ||||
|         } | ||||
|         return true | ||||
|     } | ||||
|  | ||||
|     override fun onDestroyView(view: View) { | ||||
|         super.onDestroyView(view) | ||||
|     } | ||||
|  | ||||
|     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { | ||||
|         inflater.inflate(R.menu.migration_list, menu) | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user