itube-specs 0.0.608 → 0.0.609
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -125,8 +125,6 @@ const props = defineProps<{
|
|
|
125
125
|
userPlaylists: PaginatedResponse<IPlaylistCard> | null
|
|
126
126
|
}>()
|
|
127
127
|
|
|
128
|
-
const route = useRoute();
|
|
129
|
-
|
|
130
128
|
const emit = defineEmits<{
|
|
131
129
|
(eventName: 'post-playlist', eventValue: IPlaylistShort): void
|
|
132
130
|
(eventName: 'execute-user-playlists'): void
|
|
@@ -150,7 +148,6 @@ const playlistsItems = computed(() => {
|
|
|
150
148
|
}))
|
|
151
149
|
})
|
|
152
150
|
|
|
153
|
-
const id = computed(() => String(route.params['playlistId']));
|
|
154
151
|
|
|
155
152
|
function togglePlaylist(value: string) {
|
|
156
153
|
const idx = selectValue.value.indexOf(value);
|
|
@@ -179,9 +176,21 @@ function clearNewPlaylist() {
|
|
|
179
176
|
}
|
|
180
177
|
|
|
181
178
|
function createPlaylist() {
|
|
182
|
-
|
|
179
|
+
const name = newPlaylistName.value.trim();
|
|
180
|
+
if (!name) return;
|
|
181
|
+
|
|
182
|
+
const nameExists = props.userPlaylists?.items?.some(
|
|
183
|
+
(item: IPlaylistCard) => item.name.toLowerCase() === name.toLowerCase()
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
if (nameExists) {
|
|
187
|
+
snackbarTheme.value = 'error';
|
|
188
|
+
snackbarText.value = 'playlist_name_exists';
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
183
192
|
emit('post-playlist', {
|
|
184
|
-
name
|
|
193
|
+
name,
|
|
185
194
|
type: isPrivate.value ? EPlaylistType.Private : EPlaylistType.Public,
|
|
186
195
|
});
|
|
187
196
|
newPlaylistName.value = '';
|