mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-22 12:32:31 +01:00
Minor cleanup
This commit is contained in:
@@ -49,7 +49,7 @@ fun Context.notificationBuilder(channelId: String, block: (NotificationCompat.Bu
|
|||||||
/**
|
/**
|
||||||
* Helper method to create a notification.
|
* Helper method to create a notification.
|
||||||
*
|
*
|
||||||
* @param id the channel id.
|
* @param channelId the channel id.
|
||||||
* @param block the function that will execute inside the builder.
|
* @param block the function that will execute inside the builder.
|
||||||
* @return a notification to be displayed or updated.
|
* @return a notification to be displayed or updated.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ data class Manga(
|
|||||||
val unreadCount: Int?,
|
val unreadCount: Int?,
|
||||||
val downloadCount: Int?,
|
val downloadCount: Int?,
|
||||||
val chapterCount: Int?,
|
val chapterCount: Int?,
|
||||||
var lastChapterRead: Chapter?,
|
val lastChapterRead: Chapter?,
|
||||||
val age: Long?,
|
val age: Long?,
|
||||||
val chaptersAge: Long?
|
val chaptersAge: Long?
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ class ExtensionsScreenViewModel @Inject constructor(
|
|||||||
langs.map { it.lang }.distinct().toImmutableList()
|
langs.map { it.lang }.distinct().toImmutableList()
|
||||||
}.stateIn(scope, SharingStarted.Eagerly, persistentListOf())
|
}.stateIn(scope, SharingStarted.Eagerly, persistentListOf())
|
||||||
|
|
||||||
private val _isLoading = MutableStateFlow(true)
|
val isLoading = extensionList.map { it == null }.stateIn(scope, SharingStarted.Eagerly, true)
|
||||||
val isLoading = _isLoading.asStateFlow()
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
@@ -85,7 +84,6 @@ class ExtensionsScreenViewModel @Inject constructor(
|
|||||||
|
|
||||||
private suspend fun getExtensions() {
|
private suspend fun getExtensions() {
|
||||||
extensionList.value = getExtensionList.await(onError = { toast(it.message.orEmpty()) }).orEmpty()
|
extensionList.value = getExtensionList.await(onError = { toast(it.message.orEmpty()) }).orEmpty()
|
||||||
_isLoading.value = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun install(source: Source) {
|
fun install(source: Source) {
|
||||||
|
|||||||
Reference in New Issue
Block a user