Fetch local playlists only when adding to playlist in MediaItemMenu

This commit is contained in:
vfsfitvnm 2022-07-27 11:23:07 +02:00
parent d4f2b68ca3
commit d85a9b68cd

View file

@ -292,10 +292,6 @@ fun MediaItemMenu(
onShare: (() -> Unit)? = null,
onGlobalRouteEmitted: (() -> Unit)? = null,
) {
val playlistPreviews by remember {
Database.playlistPreviews(PlaylistSortBy.DateAdded, SortOrder.Descending)
}.collectAsState(initial = emptyList(), context = Dispatchers.IO)
Menu(modifier = modifier) {
RouteHandler(
transitionSpec = {
@ -311,6 +307,10 @@ fun MediaItemMenu(
}
) {
viewPlaylistsRoute {
val playlistPreviews by remember {
Database.playlistPreviews(PlaylistSortBy.DateAdded, SortOrder.Descending)
}.collectAsState(initial = emptyList(), context = Dispatchers.IO)
var isCreatingNewPlaylist by rememberSaveable {
mutableStateOf(false)
}