Fix no feed placeholder not appearing in FeedTab

This commit is contained in:
Shinokuni 2024-02-19 22:59:19 +01:00
parent 5a0affdf3b
commit 40accbc8b4
2 changed files with 20 additions and 7 deletions
appcompose/src/main/java/com/readrops/app/compose
repositories
util/components

@ -18,7 +18,13 @@ class GetFoldersWithFeeds(
.selectFeedsWithoutFolder(accountId)
) { folders, feedsWithoutFolder ->
val foldersWithFeeds = folders.groupBy(
keySelector = { Folder(id = it.folderId, name = it.folderName, accountId = it.accountId) },
keySelector = {
Folder(
id = it.folderId,
name = it.folderName,
accountId = it.accountId
) as Folder?
},
valueTransform = {
Feed(
id = it.feedId,
@ -37,11 +43,15 @@ class GetFoldersWithFeeds(
}
}
foldersWithFeeds + mapOf(
Pair(
null,
feedsWithoutFolder.map { it.feed.apply { unreadCount = it.unreadCount } })
)
if (feedsWithoutFolder.isNotEmpty()) {
foldersWithFeeds + mapOf(
Pair(
null,
feedsWithoutFolder.map { it.feed.apply { unreadCount = it.unreadCount } })
)
}
foldersWithFeeds
}
}
}

@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import com.readrops.app.compose.util.theme.ShortSpacer
import com.readrops.app.compose.util.toDp
@ -39,9 +40,11 @@ fun Placeholder(
modifier = Modifier.size(MaterialTheme.typography.displayMedium.toDp() * 1.5f)
)
ShortSpacer()
Text(
text = text,
style = MaterialTheme.typography.displayMedium
style = MaterialTheme.typography.displaySmall
)
}
}