Browse Source

Clean up double click handler vars

master
jeffvli 3 years ago
committed by Jeff
parent
commit
5cd1b19171
  1. 8
      src/components/library/AlbumView.tsx
  2. 4
      src/components/library/ArtistView.tsx
  3. 8
      src/components/playlist/PlaylistView.tsx
  4. 12
      src/components/starred/StarredView.tsx

8
src/components/library/AlbumView.tsx

@ -81,7 +81,7 @@ const AlbumView = ({ ...rest }: any) => {
}
};
const handleRowDoubleClick = (e: any) => {
const handleRowDoubleClick = (rowData: any) => {
window.clearTimeout(timeout);
timeout = null;
@ -89,9 +89,9 @@ const AlbumView = ({ ...rest }: any) => {
dispatch(
setPlayQueueByRowClick({
entries: data.song,
currentIndex: e.index,
currentSongId: e.id,
uniqueSongId: e.uniqueId,
currentIndex: rowData.index,
currentSongId: rowData.id,
uniqueSongId: rowData.uniqueId,
})
);
dispatch(setStatus('PLAYING'));

4
src/components/library/ArtistView.tsx

@ -83,11 +83,11 @@ const ArtistView = ({ ...rest }: any) => {
}
};
const handleRowDoubleClick = (e: any) => {
const handleRowDoubleClick = (rowData: any) => {
window.clearTimeout(timeout);
timeout = null;
dispatch(clearSelected());
history.push(`/library/album/${e.id}`);
history.push(`/library/album/${rowData.id}`);
};
const handleFavorite = async () => {

8
src/components/playlist/PlaylistView.tsx

@ -153,7 +153,7 @@ const PlaylistView = ({ ...rest }) => {
}
};
const handleRowDoubleClick = (e: any) => {
const handleRowDoubleClick = (rowData: any) => {
window.clearTimeout(timeout);
timeout = null;
@ -161,9 +161,9 @@ const PlaylistView = ({ ...rest }) => {
dispatch(
setPlayQueueByRowClick({
entries: playlist[getCurrentEntryList(playlist)],
currentIndex: e.rowIndex,
currentSongId: e.id,
uniqueSongId: e.uniqueId,
currentIndex: rowData.rowIndex,
currentSongId: rowData.id,
uniqueSongId: rowData.uniqueId,
})
);
dispatch(setStatus('PLAYING'));

12
src/components/starred/StarredView.tsx

@ -72,7 +72,7 @@ const StarredView = () => {
}
};
const handleRowDoubleClick = (e: any) => {
const handleRowDoubleClick = (rowData: any) => {
window.clearTimeout(timeout);
timeout = null;
dispatch(clearSelected());
@ -81,17 +81,17 @@ const StarredView = () => {
dispatch(
setPlayQueueByRowClick({
entries: data.song,
currentIndex: e.index,
currentSongId: e.id,
uniqueSongId: e.uniqueId,
currentIndex: rowData.index,
currentSongId: rowData.id,
uniqueSongId: rowData.uniqueId,
})
);
dispatch(setStatus('PLAYING'));
dispatch(fixPlayer2Index());
} else if (favorite.active.tab === 'albums') {
history.push(`/library/album/${e.id}`);
history.push(`/library/album/${rowData.id}`);
} else {
history.push(`/library/artist/${e.id}`);
history.push(`/library/artist/${rowData.id}`);
}
};

Loading…
Cancel
Save