mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 11:51:50 +01:00
parent
f0af3858e8
commit
ec272f6c4e
@ -187,7 +187,7 @@ class NotificationReceiver : BroadcastReceiver() {
|
|||||||
}
|
}
|
||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
} else {
|
} else {
|
||||||
context.toast(context.getString(R.string.chapter_error))
|
context.toast(R.string.chapter_error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,8 +239,8 @@ open class BrowseSourcePresenter(
|
|||||||
var new = manga.copy(
|
var new = manga.copy(
|
||||||
favorite = !manga.favorite,
|
favorite = !manga.favorite,
|
||||||
dateAdded = when (manga.favorite) {
|
dateAdded = when (manga.favorite) {
|
||||||
true -> Date().time
|
true -> 0
|
||||||
false -> 0
|
false -> Date().time
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -272,7 +272,6 @@ open class BrowseSourcePresenter(
|
|||||||
moveMangaToCategories(manga, defaultCategory)
|
moveMangaToCategories(manga, defaultCategory)
|
||||||
|
|
||||||
changeMangaFavorite(manga)
|
changeMangaFavorite(manga)
|
||||||
// activity.toast(activity.getString(R.string.manga_added_library))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatic 'Default' or no categories
|
// Automatic 'Default' or no categories
|
||||||
@ -280,7 +279,6 @@ open class BrowseSourcePresenter(
|
|||||||
moveMangaToCategories(manga)
|
moveMangaToCategories(manga)
|
||||||
|
|
||||||
changeMangaFavorite(manga)
|
changeMangaFavorite(manga)
|
||||||
// activity.toast(activity.getString(R.string.manga_added_library))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Choose a category
|
// Choose a category
|
||||||
|
@ -256,13 +256,13 @@ class MangaController : FullComposeController<MangaPresenter> {
|
|||||||
private fun onFavoriteClick() {
|
private fun onFavoriteClick() {
|
||||||
presenter.toggleFavorite(
|
presenter.toggleFavorite(
|
||||||
onRemoved = this::onFavoriteRemoved,
|
onRemoved = this::onFavoriteRemoved,
|
||||||
onAdded = { activity?.toast(activity?.getString(R.string.manga_added_library)) },
|
onAdded = { activity?.toast(R.string.manga_added_library) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onFavoriteRemoved() {
|
private fun onFavoriteRemoved() {
|
||||||
val context = activity ?: return
|
val context = activity ?: return
|
||||||
context.toast(activity?.getString(R.string.manga_removed_library))
|
context.toast(R.string.manga_removed_library)
|
||||||
viewScope.launch {
|
viewScope.launch {
|
||||||
if (!presenter.hasDownloads()) return@launch
|
if (!presenter.hasDownloads()) return@launch
|
||||||
val result = snackbarHostState.showSnackbar(
|
val result = snackbarHostState.showSnackbar(
|
||||||
@ -367,7 +367,7 @@ class MangaController : FullComposeController<MangaPresenter> {
|
|||||||
|
|
||||||
fun onFetchChaptersError(error: Throwable) {
|
fun onFetchChaptersError(error: Throwable) {
|
||||||
if (error is NoChaptersException) {
|
if (error is NoChaptersException) {
|
||||||
activity?.toast(activity?.getString(R.string.no_chapters_error))
|
activity?.toast(R.string.no_chapters_error)
|
||||||
} else {
|
} else {
|
||||||
activity?.toast(error.message)
|
activity?.toast(error.message)
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class SetChapterSettingsDialog(bundle: Bundle? = null) : DialogController(bundle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activity?.toast(activity!!.getString(R.string.chapter_settings_updated))
|
activity?.toast(R.string.chapter_settings_updated)
|
||||||
}
|
}
|
||||||
.setNegativeButton(android.R.string.cancel, null)
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
.create()
|
.create()
|
||||||
|
Loading…
Reference in New Issue
Block a user