From 5cd1b191712a0adf396a17ff50fcb8863a836d9b Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 27 Oct 2021 15:19:56 -0700 Subject: [PATCH] Clean up double click handler vars --- src/components/library/AlbumView.tsx | 8 ++++---- src/components/library/ArtistView.tsx | 4 ++-- src/components/playlist/PlaylistView.tsx | 8 ++++---- src/components/starred/StarredView.tsx | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/library/AlbumView.tsx b/src/components/library/AlbumView.tsx index 36fad7b..04a1500 100644 --- a/src/components/library/AlbumView.tsx +++ b/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')); diff --git a/src/components/library/ArtistView.tsx b/src/components/library/ArtistView.tsx index a87f59a..f080531 100644 --- a/src/components/library/ArtistView.tsx +++ b/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 () => { diff --git a/src/components/playlist/PlaylistView.tsx b/src/components/playlist/PlaylistView.tsx index 38e1fcc..fce5959 100644 --- a/src/components/playlist/PlaylistView.tsx +++ b/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')); diff --git a/src/components/starred/StarredView.tsx b/src/components/starred/StarredView.tsx index 91b6b39..6c940ea 100644 --- a/src/components/starred/StarredView.tsx +++ b/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}`); } };