From 8ea56aa0b9de5344217038006127c91f10a432ac Mon Sep 17 00:00:00 2001
From: FireMaskterK <20838718+FireMasterK@users.noreply.github.com>
Date: Mon, 1 Nov 2021 20:23:04 +0000
Subject: [PATCH] Implement comment replies.
---
src/components/Comment.vue | 43 +++++++++++++++++++++++++++++++++++
src/components/WatchVideo.vue | 2 +-
src/main.js | 2 ++
3 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/src/components/Comment.vue b/src/components/Comment.vue
index 45cf557e..d14cf647 100644
--- a/src/components/Comment.vue
+++ b/src/components/Comment.vue
@@ -3,6 +3,8 @@
+
+
@@ -47,6 +71,25 @@ export default {
},
},
uploader: { type: String, default: null },
+ videoId: { type: String, default: null },
+ },
+ data() {
+ return {
+ notLoading: true,
+ replies: [],
+ nextpage: null,
+ };
+ },
+ methods: {
+ loadReplies() {
+ this.notLoading = false;
+ this.fetchJson(this.apiUrl() + "/nextpage/comments/" + this.videoId, {
+ nextpage: this.nextpage || this.comment.repliesPage,
+ }).then(json => {
+ this.replies = this.replies.concat(json.comments);
+ this.nextpage = json.nextpage;
+ });
+ },
},
};
diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue
index c16d05b8..dd62672b 100644
--- a/src/components/WatchVideo.vue
+++ b/src/components/WatchVideo.vue
@@ -123,7 +123,7 @@
class="uk-tile-default uk-align-left uk-width-expand"
:style="[{ background: backgroundColor }]"
>
-
+
diff --git a/src/main.js b/src/main.js
index f885b13d..97da8fe9 100644
--- a/src/main.js
+++ b/src/main.js
@@ -10,6 +10,7 @@ import {
faHeadphones,
faRss,
faChevronLeft,
+ faLevelDownAlt,
faTv,
} from "@fortawesome/free-solid-svg-icons";
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons";
@@ -27,6 +28,7 @@ library.add(
faYoutube,
faRss,
faChevronLeft,
+ faLevelDownAlt,
faTv,
);