Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not hide playlist items when playlist meta is loading #2973

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/PlaylistManager/Panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ function PlaylistPanel(props: PlaylistPanelProps) {
const size = media.length;

let list;
if (loading) {
if (loading && size > 0 && media.every((item) => item == null)) {
list = (
<div className="PlaylistPanel-loading">
<CircularProgress size="100%" />
</div>
);
} else if (isFiltered && media.length === 0) {
} else if (isFiltered && size === 0) {
list = <PlaylistFilterEmpty />;
} else if (size === 0) {
list = <PlaylistEmpty />;
Expand Down
4 changes: 0 additions & 4 deletions src/reducers/playlists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,6 @@ const slice = createSlice({
return initialState;
})
.addCase(activatePlaylist.pending, (state, action) => {
// TODO use a different property here so we can show a loading icon on
// the "Active" button only, instead of on top of the entire playlist
const playlist = state.playlists[action.meta.arg];
if (playlist != null) {
playlist.loading = true;
Expand All @@ -500,8 +498,6 @@ const slice = createSlice({
}
})
.addCase(activatePlaylist.fulfilled, (state, action) => {
// TODO use a different property here so we can show a loading icon on
// the "Active" button only, instead of on top of the entire playlist
const playlist = state.playlists[action.meta.arg];
if (playlist != null) {
playlist.loading = false;
Expand Down
Loading