Skip to content

Commit

Permalink
fix: 修复播放列表页触发播放该列表时路由错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
QingXia-Ela committed Aug 25, 2024
1 parent d917328 commit 79558f9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "monster-siren-desktop",
"private": true,
"version": "1.1.0",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -91,4 +91,4 @@
"website-scraper": "^5.3.1",
"ws": "^8.13.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getAlbumDetail } from '@/api/modules/album';
import Button from '@/components/Button';
import BlackMenuItem from '@/components/ContextMenu/BlackMenuV2/BlackMenuItem';
import Divider from '@/components/ContextMenu/BlackMenuV2/Divider';
Expand Down Expand Up @@ -77,12 +78,20 @@ async function removePlaylistWithNotice(cid: string) {
function PlaylistLeftCtxMenu({ cid, handleClose }: PlaylistLeftCtxMenuProps) {
const [confirmDel, setConfirmDel] = useState(false);
const [modifyInfo, setModifyInfo] = useState(false);
const play = () => {
SirenStore.dispatch({
type: 'musicPlay/toAlbum',
cid,
});
const play = async () => {
handleClose();
const res = await (await getAlbumDetail(cid)).json();
const songId = res.data.songs[0]?.cid
if (songId) {
SirenStore.dispatch({
type: 'player/selectSong',
cid: songId,
});
SirenStore.dispatch({
type: 'player/setIsPlaying',
isPlaying: true,
});
}
};
const callTauriDeletePlaylist = async () => {
handleClose();
Expand Down
2 changes: 0 additions & 2 deletions src/store/models/customPlaylist/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ invoke('plugin:playlist|get_all_playlists', {
});

export async function addSongToPlaylist(playlistId: string, song: any) {
console.log(song);

await invoke('plugin:playlist|add_song_to_playlist', {
playlistId,
song,
Expand Down

0 comments on commit 79558f9

Please sign in to comment.