Merge pull request #1126 from GilgusMaximus/development

Reimplementation of goToChannel from PR 850
This commit is contained in:
Luca Hohmann 2021-03-18 17:53:13 +01:00 committed by GitHub
commit 0275efcb80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -34,6 +34,7 @@
height: 60px; height: 60px;
border-radius: 200px 200px 200px 200px; border-radius: 200px 200px 200px 200px;
-webkit-border-radius: 200px 200px 200px 200px; -webkit-border-radius: 200px 200px 200px 200px;
cursor: pointer;
} }
.commentAuthor { .commentAuthor {
@ -41,6 +42,7 @@
font-size: 14px; font-size: 14px;
margin-left: 68px; margin-left: 68px;
margin-top: 0px; margin-top: 0px;
cursor: pointer;
} }
.commentText { .commentText {

View File

@ -227,6 +227,7 @@ export default Vue.extend({
parseLocalCommentData: function (response, index = null) { parseLocalCommentData: function (response, index = null) {
const commentData = response.comments.map((comment) => { const commentData = response.comments.map((comment) => {
comment.authorLink = comment.authorId
comment.showReplies = false comment.showReplies = false
comment.authorThumb = comment.authorThumb[0].url comment.authorThumb = comment.authorThumb[0].url
comment.replies = [] comment.replies = []
@ -273,6 +274,7 @@ export default Vue.extend({
this.invidiousAPICall(payload).then((response) => { this.invidiousAPICall(payload).then((response) => {
const commentData = response.comments.map((comment) => { const commentData = response.comments.map((comment) => {
comment.showReplies = false comment.showReplies = false
comment.authorLink = comment.authorId
comment.authorThumb = comment.authorThumbnails[1].url.replace('https://yt3.ggpht.com', `${this.invidiousInstance}/ggpht/`) comment.authorThumb = comment.authorThumbnails[1].url.replace('https://yt3.ggpht.com', `${this.invidiousInstance}/ggpht/`)
if (this.hideCommentLikes) { if (this.hideCommentLikes) {
comment.likes = null comment.likes = null
@ -338,6 +340,7 @@ export default Vue.extend({
this.$store.dispatch('invidiousAPICall', payload).then((response) => { this.$store.dispatch('invidiousAPICall', payload).then((response) => {
const commentData = response.comments.map((comment) => { const commentData = response.comments.map((comment) => {
comment.showReplies = false comment.showReplies = false
comment.authorLink = comment.authorId
comment.authorThumb = comment.authorThumbnails[1].url.replace('https://yt3.ggpht.com', `${this.invidiousInstance}/ggpht/`) comment.authorThumb = comment.authorThumbnails[1].url.replace('https://yt3.ggpht.com', `${this.invidiousInstance}/ggpht/`)
if (this.hideCommentLikes) { if (this.hideCommentLikes) {
comment.likes = null comment.likes = null
@ -372,6 +375,10 @@ export default Vue.extend({
}) })
}, },
goToChannel: function (channelId) {
this.$router.push({ path: `/channel/${channelId}` })
},
...mapActions([ ...mapActions([
'showToast', 'showToast',
'toLocalePublicationString', 'toLocalePublicationString',

View File

@ -45,8 +45,11 @@
<img <img
:src="comment.authorThumb" :src="comment.authorThumb"
class="commentThumbnail" class="commentThumbnail"
@click="goToChannel(comment.authorLink)"
>
<p class="commentAuthor"
@click="goToChannel(comment.authorLink)"
> >
<p class="commentAuthor">
{{ comment.author }} {{ comment.author }}
<span class="commentDate"> <span class="commentDate">
{{ comment.time }} {{ comment.time }}