stuff
This commit is contained in:
@@ -6,6 +6,8 @@ interface UiState {
|
||||
activeTrackContextMenuId: string | null;
|
||||
/** Track whose info drawer is open (rightmost drawer); null = closed. */
|
||||
trackInfoId: string | null;
|
||||
/** Track for which the "Add to playlist" dialog is open; null = closed. */
|
||||
addToPlaylistTrackId: string | null;
|
||||
}
|
||||
|
||||
const initialState: UiState = {
|
||||
@@ -13,6 +15,7 @@ const initialState: UiState = {
|
||||
activeModal: null,
|
||||
activeTrackContextMenuId: null,
|
||||
trackInfoId: null,
|
||||
addToPlaylistTrackId: null,
|
||||
};
|
||||
|
||||
export const uiSlice = createSlice({
|
||||
@@ -40,6 +43,12 @@ export const uiSlice = createSlice({
|
||||
closeTrackInfo(state) {
|
||||
state.trackInfoId = null;
|
||||
},
|
||||
openAddToPlaylist(state, action: PayloadAction<string>) {
|
||||
state.addToPlaylistTrackId = action.payload;
|
||||
},
|
||||
closeAddToPlaylist(state) {
|
||||
state.addToPlaylistTrackId = null;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -51,5 +60,7 @@ export const {
|
||||
setActiveContextMenu,
|
||||
openTrackInfo,
|
||||
closeTrackInfo,
|
||||
openAddToPlaylist,
|
||||
closeAddToPlaylist,
|
||||
} = uiSlice.actions;
|
||||
export default uiSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user