Content-Length: 250751 | pFad | http://github.com/Arthi-chaud/Meelo/commit/82b169718fb6a0717fff05fd360ac2305e7e9cbc

78 Front: Save Queue as Playlist · Arthi-chaud/Meelo@82b1697 · GitHub
Skip to content

Commit

Permalink
Front: Save Queue as Playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthi-chaud committed Feb 22, 2025
1 parent becfd85 commit 82b1697
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 133 deletions.
10 changes: 7 additions & 3 deletions front/src/components/actions/playlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const PlayAfterAction = (
});

type CreateOrUpdatePlaylistFormProps = {
onSubmit: (newUrl: string) => void;
onSubmit: (playlistName: string) => void;
onClose: () => void;
defaultValue?: string;
};
Expand Down Expand Up @@ -136,15 +136,19 @@ const CreateOrUpdatePlaylistForm = (props: CreateOrUpdatePlaylistFormProps) => {
);
};

export const CreatePlaylistAction = (queryClient: QueryClient): Action => ({
export const CreatePlaylistAction = (
queryClient: QueryClient,
onCreated?: (playlistId: number) => void,
): Action => ({
label: "new",
icon: <Add />,
dialog: ({ close }) => {
const mutation = useMutation((playlistName: string) => {
return API.createPlaylist(playlistName)
.then(() => {
.then((playlist) => {
toast.success("Playlist created!");
queryClient.client.invalidateQueries("playlists");
onCreated?.(playlist.id);
})
.catch((error: Error) => toast.error(error.message));
});
Expand Down
Loading

0 comments on commit 82b1697

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Arthi-chaud/Meelo/commit/82b169718fb6a0717fff05fd360ac2305e7e9cbc

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy