diff --git a/src/renderer/src/components/playlist/playlist-create/PlaylistCreateBox.tsx b/src/renderer/src/components/playlist/playlist-create/PlaylistCreateBox.tsx index ecac452..8be1104 100644 --- a/src/renderer/src/components/playlist/playlist-create/PlaylistCreateBox.tsx +++ b/src/renderer/src/components/playlist/playlist-create/PlaylistCreateBox.tsx @@ -29,8 +29,12 @@ const PlaylistCreateBox: Component = (props) => { return; } + const song = createPlaylistBoxSong(); + setPlaylistName(""); - props.reset.pulse(); + if (song === undefined) { + props.reset.pulse(); + } setShowPlaylistCreateBox(false); addNotice({ @@ -40,7 +44,6 @@ const PlaylistCreateBox: Component = (props) => { icon: , }); - const song = createPlaylistBoxSong(); if (song !== undefined) { const songResult = await window.api.request("playlist::add", name, song); setCreatePlaylistBoxSong(undefined); @@ -88,6 +91,11 @@ const PlaylistCreateBox: Component = (props) => { onInput={(e) => { setPlaylistName(e.target.value); }} + onKeyPress={(k) => { + if (k.key == "Enter") { + createPlaylist(); + } + }} />