Skip to content

Commit

Permalink
enter to create + fix playlist view bug
Browse files Browse the repository at this point in the history
  • Loading branch information
D0m1nos committed Nov 26, 2024
1 parent 5d2aa27 commit 0112aa1
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ const PlaylistCreateBox: Component<PlaylistCreateBoxProps> = (props) => {
return;
}

const song = createPlaylistBoxSong();

setPlaylistName("");
props.reset.pulse();
if (song === undefined) {
props.reset.pulse();
}
setShowPlaylistCreateBox(false);

addNotice({
Expand All @@ -40,7 +44,6 @@ const PlaylistCreateBox: Component<PlaylistCreateBoxProps> = (props) => {
icon: <CircleCheckIcon size={20} />,
});

const song = createPlaylistBoxSong();
if (song !== undefined) {
const songResult = await window.api.request("playlist::add", name, song);
setCreatePlaylistBoxSong(undefined);
Expand Down Expand Up @@ -88,6 +91,11 @@ const PlaylistCreateBox: Component<PlaylistCreateBoxProps> = (props) => {
onInput={(e) => {
setPlaylistName(e.target.value);
}}
onKeyPress={(k) => {
if (k.key == "Enter") {
createPlaylist();
}
}}
/>
<Button
class="cursor-pointer text-center"
Expand Down

0 comments on commit 0112aa1

Please sign in to comment.