mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10:12 +02:00
Replace success toast with info when no songs are added (#1994)
This commit is contained in:
@@ -347,6 +347,7 @@
|
|||||||
"input_skipDuplicates": "skip duplicates",
|
"input_skipDuplicates": "skip duplicates",
|
||||||
"searchOrCreate": "search $t(entity.playlist, {\"count\": 2}) or type to create a new one",
|
"searchOrCreate": "search $t(entity.playlist, {\"count\": 2}) or type to create a new one",
|
||||||
"success": "added $t(entity.trackWithCount, {\"count\": {{message}} }) to $t(entity.playlistWithCount, {\"count\": {{numOfPlaylists}} })",
|
"success": "added $t(entity.trackWithCount, {\"count\": {{message}} }) to $t(entity.playlistWithCount, {\"count\": {{numOfPlaylists}} })",
|
||||||
|
"noneAdded": "no tracks were added to $t(entity.playlist, {\"count\": 1}) '{{playlist}}'",
|
||||||
"title": "add to $t(entity.playlist, {\"count\": 1})"
|
"title": "add to $t(entity.playlist, {\"count\": 1})"
|
||||||
},
|
},
|
||||||
"createPlaylist": {
|
"createPlaylist": {
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleAddToPlaylist = useCallback(
|
const handleAddToPlaylist = useCallback(
|
||||||
async (playlistId: string) => {
|
async (playlistId: string, playlistName: string) => {
|
||||||
if (items.length === 0 || !serverId) return;
|
if (items.length === 0 || !serverId) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -202,10 +202,9 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (allSongIds.length === 0) {
|
if (allSongIds.length === 0) {
|
||||||
toast.success({
|
toast.info({
|
||||||
message: t('form.addToPlaylist.success', {
|
message: t('form.addToPlaylist.noneAdded', {
|
||||||
message: 0,
|
playlist: playlistName,
|
||||||
numOfPlaylists: 1,
|
|
||||||
postProcess: 'sentenceCase',
|
postProcess: 'sentenceCase',
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -245,10 +244,9 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (songsToAdd.length === 0) {
|
if (songsToAdd.length === 0) {
|
||||||
toast.success({
|
toast.info({
|
||||||
message: t('form.addToPlaylist.success', {
|
message: t('form.addToPlaylist.noneAdded', {
|
||||||
message: 0,
|
playlist: playlistName,
|
||||||
numOfPlaylists: 1,
|
|
||||||
postProcess: 'sentenceCase',
|
postProcess: 'sentenceCase',
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -413,7 +411,9 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
|
|||||||
<>
|
<>
|
||||||
<ContextMenu.Item
|
<ContextMenu.Item
|
||||||
key={recentPlaylist.id}
|
key={recentPlaylist.id}
|
||||||
onSelect={() => handleAddToPlaylist(recentPlaylist.id)}
|
onSelect={() =>
|
||||||
|
handleAddToPlaylist(recentPlaylist.id, recentPlaylist.name)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{recentPlaylist.name}
|
{recentPlaylist.name}
|
||||||
</ContextMenu.Item>
|
</ContextMenu.Item>
|
||||||
@@ -428,7 +428,7 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
|
|||||||
{filteredPlaylists.map((playlist) => (
|
{filteredPlaylists.map((playlist) => (
|
||||||
<ContextMenu.Item
|
<ContextMenu.Item
|
||||||
key={playlist.id}
|
key={playlist.id}
|
||||||
onSelect={() => handleAddToPlaylist(playlist.id)}
|
onSelect={() => handleAddToPlaylist(playlist.id, playlist.name)}
|
||||||
>
|
>
|
||||||
{playlist.name}
|
{playlist.name}
|
||||||
</ContextMenu.Item>
|
</ContextMenu.Item>
|
||||||
|
|||||||
Reference in New Issue
Block a user