Browse Source

Add toasts, change wording for play vs append

master
jeffvli 3 years ago
parent
commit
0f7b0e3caa
  1. 6
      src/components/card/Card.tsx
  2. 3
      src/components/library/AlbumView.tsx
  3. 2
      src/components/library/ArtistView.tsx
  4. 2
      src/components/playlist/PlaylistView.tsx

6
src/components/card/Card.tsx

@ -58,19 +58,19 @@ const Card = ({
if (playClick.type === 'playlist') {
const res = await getPlaylist(playClick.id);
dispatch(setPlayQueue({ entries: res.song }));
notifyToast('info', `Added ${res.song.length} song(s) to the queue`);
notifyToast('info', `Playing ${res.song.length} song(s)`);
}
if (playClick.type === 'album') {
const res = await getAlbum(playClick.id);
dispatch(setPlayQueue({ entries: res.song }));
notifyToast('info', `Added ${res.song.length} song(s) to the queue`);
notifyToast('info', `Playing ${res.song.length} song(s)`);
}
if (playClick.type === 'artist') {
const songs = await getAllArtistSongs(playClick.id);
dispatch(setPlayQueue({ entries: songs }));
notifyToast('info', `Added ${songs.length} song(s) to the queue`);
notifyToast('info', `Playing ${songs.length} song(s)`);
}
dispatch(setStatus('PLAYING'));

3
src/components/library/AlbumView.tsx

@ -26,6 +26,7 @@ import GenericPageHeader from '../layout/GenericPageHeader';
import { TagLink } from './styled';
import { setStatus } from '../../redux/playerSlice';
import { addModalPage } from '../../redux/miscSlice';
import { notifyToast } from '../shared/toast';
interface AlbumParams {
id: string;
@ -92,6 +93,7 @@ const AlbumView = ({ ...rest }: any) => {
const handlePlay = () => {
dispatch(setPlayQueue({ entries: data.song }));
dispatch(setStatus('PLAYING'));
notifyToast('info', `Playing ${data.song.length} song(s)`);
};
const handlePlayAppend = () => {
@ -99,6 +101,7 @@ const AlbumView = ({ ...rest }: any) => {
if (playQueue.entry.length < 1) {
dispatch(setStatus('PLAYING'));
}
notifyToast('info', `Added ${data.song.length} song(s) to the queue`);
};
const handleFavorite = async () => {

2
src/components/library/ArtistView.tsx

@ -92,7 +92,7 @@ const ArtistView = ({ ...rest }: any) => {
const handlePlay = async () => {
const songs = await getAllArtistSongs(data.id);
dispatch(setPlayQueue({ entries: songs }));
notifyToast('info', `Added ${songs.length} song(s) to the queue`);
notifyToast('info', `Playing ${songs.length} song(s)`);
};
const handlePlayAppend = async () => {

2
src/components/playlist/PlaylistView.tsx

@ -161,6 +161,7 @@ const PlaylistView = ({ ...rest }) => {
const handlePlay = () => {
dispatch(setPlayQueue({ entries: playlist.entry }));
dispatch(setStatus('PLAYING'));
notifyToast('info', `Playing ${playlist.entry.length} song(s)`);
};
const handlePlayAppend = () => {
@ -168,6 +169,7 @@ const PlaylistView = ({ ...rest }) => {
if (playQueue.entry.length < 1) {
dispatch(setStatus('PLAYING'));
}
notifyToast('info', `Added ${playlist.entry.length} song(s) to the queue`);
};
const handleSave = async (recovery: boolean) => {

Loading…
Cancel
Save