ci(release): switch registry login to REGISTRY_TOKEN #3
+8
-11
@@ -60,22 +60,19 @@ fun AddToPlaylistSheet(
|
|||||||
modifier = Modifier.fillMaxWidth().padding(24.dp),
|
modifier = Modifier.fillMaxWidth().padding(24.dp),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) { CircularProgressIndicator(color = MaterialTheme.colorScheme.primary) }
|
) { CircularProgressIndicator(color = MaterialTheme.colorScheme.primary) }
|
||||||
|
UiState.Empty -> Text(
|
||||||
|
text = "You haven't created any playlists yet.",
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.padding(horizontal = 20.dp, vertical = 12.dp),
|
||||||
|
)
|
||||||
is UiState.Error -> Text(
|
is UiState.Error -> Text(
|
||||||
text = s.message,
|
text = s.message,
|
||||||
color = MaterialTheme.colorScheme.error,
|
color = MaterialTheme.colorScheme.error,
|
||||||
modifier = Modifier.padding(horizontal = 20.dp, vertical = 12.dp),
|
modifier = Modifier.padding(horizontal = 20.dp, vertical = 12.dp),
|
||||||
)
|
)
|
||||||
is UiState.Success -> if (s.data.isEmpty()) {
|
is UiState.Success -> LazyColumn(modifier = Modifier.fillMaxWidth()) {
|
||||||
Text(
|
items(items = s.data, key = { it.id }) { p ->
|
||||||
text = "You haven't created any playlists yet.",
|
PlaylistPickRow(playlist = p, onClick = { onPick(p.id) })
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
||||||
modifier = Modifier.padding(horizontal = 20.dp, vertical = 12.dp),
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
LazyColumn(modifier = Modifier.fillMaxWidth()) {
|
|
||||||
items(items = s.data, key = { it.id }) { p ->
|
|
||||||
PlaylistPickRow(playlist = p, onClick = { onPick(p.id) })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -30,7 +30,9 @@ class AddToPlaylistViewModel @Inject constructor(
|
|||||||
|
|
||||||
val uiState: StateFlow<UiState<List<PlaylistRef>>> = repository
|
val uiState: StateFlow<UiState<List<PlaylistRef>>> = repository
|
||||||
.observeUserPlaylists()
|
.observeUserPlaylists()
|
||||||
.map { list -> UiState.Success(list) as UiState<List<PlaylistRef>> }
|
.map { list ->
|
||||||
|
if (list.isEmpty()) UiState.Empty else UiState.Success(list)
|
||||||
|
}
|
||||||
.onStart {
|
.onStart {
|
||||||
// Best-effort refresh so the sheet reflects newly-created
|
// Best-effort refresh so the sheet reflects newly-created
|
||||||
// playlists from another device. Cached list shows first;
|
// playlists from another device. Cached list shows first;
|
||||||
|
|||||||
Reference in New Issue
Block a user