Minor cleanup

This commit is contained in:
Syer10
2022-12-22 16:44:38 -05:00
parent 644019850b
commit 0c58727dd5
3 changed files with 3 additions and 5 deletions

View File

@@ -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.
*/ */

View File

@@ -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?
) )

View File

@@ -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) {