From d40344e65106d90e68fe6c6c520f1d6aaeef643b Mon Sep 17 00:00:00 2001 From: 0xrohitgarg Date: Fri, 13 Dec 2024 18:35:19 +0530 Subject: [PATCH] optional pagination in video list --- src/components/collection/VideoList.vue | 28 +++++++++++++++++-- .../message-handlers/ChatVideos.vue | 6 +++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/components/collection/VideoList.vue b/src/components/collection/VideoList.vue index b7df587..b556520 100644 --- a/src/components/collection/VideoList.vue +++ b/src/components/collection/VideoList.vue @@ -6,7 +6,16 @@
-
+
value >= 1 && value <= 4, + }, }); const currentPage = ref(1); @@ -69,6 +90,9 @@ const totalPages = computed(() => ); const paginatedVideos = computed(() => { + if (!props.showPagination) { + return props.videoResults; + } const start = (currentPage.value - 1) * props.itemsPerPage; const end = start + props.itemsPerPage; return props.videoResults.slice(start, end); diff --git a/src/components/message-handlers/ChatVideos.vue b/src/components/message-handlers/ChatVideos.vue index 17e0d64..6147e4b 100644 --- a/src/components/message-handlers/ChatVideos.vue +++ b/src/components/message-handlers/ChatVideos.vue @@ -10,6 +10,8 @@
@@ -65,7 +67,9 @@ const handleVideoClick = (video) => { if (video.externalUrl) { window.open(video.url, "_blank"); } else { - handleAddMessage(`@stream_video ${video.name}`); + if (video.stream_url) { + handleAddMessage(`@stream_video ${video.name}`); + } } };