Skip to content

Commit

Permalink
* Only show blank playlist name message when spaces input
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Jun 8, 2024
1 parent cc62f88 commit aa774c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export default defineComponent({
playlistNameEmpty() {
return this.playlistName === ''
},
playlistNameBlank() {
return !this.playlistNameEmpty && this.playlistName.trim() === ''
},
playlistWithNameExists() {
// Don't show the message with no name input
const playlistName = this.playlistName
Expand All @@ -54,6 +57,12 @@ export default defineComponent({
},
methods: {
handlePlaylistNameInput(input) {
if (input.trim() === '') {
// Need to show message for blank input
this.playlistName = input
return
}

this.playlistName = input.trim()
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@click="createNewPlaylist"
/>
</ft-flex-box>
<ft-flex-box v-if="playlistNameEmpty">
<ft-flex-box v-if="playlistNameBlank">
<p>
{{ $t('User Playlists.SinglePlaylistView.Toast["Playlist name cannot be empty. Please input a name."]') }}
</p>
Expand Down

0 comments on commit aa774c5

Please sign in to comment.