Skip to content

Commit 1d75c39

Browse files
committed
fix broken redirection of ChannelItem cards in ChannelList component
1 parent c27475d commit 1d75c39

File tree

1 file changed

+15
-1
lines changed
  • contentcuration/contentcuration/frontend/channelList/views/Channel

1 file changed

+15
-1
lines changed

contentcuration/contentcuration/frontend/channelList/views/Channel/ChannelItem.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
:class="{ added }"
99
data-test="channel-card"
1010
tabindex="0"
11+
:href="isInChannelList && linkToChannelTree ? channelHref : null"
12+
:to="isInChannelList ? (linkToChannelTree ? null : channelDetailsLink) : null"
1113
@click="handleChannelClick"
1214
>
1315
<VLayout row wrap>
@@ -381,6 +383,16 @@
381383
},
382384
];
383385
},
386+
linkToChannelTree() {
387+
return this.loggedIn && !this.libraryMode;
388+
},
389+
channelHref() {
390+
if (this.linkToChannelTree) {
391+
return window.Urls.channel(this.channelId);
392+
} else {
393+
return false;
394+
}
395+
},
384396
},
385397
mounted() {
386398
if (this.channel.added) {
@@ -401,7 +413,9 @@
401413
});
402414
},
403415
handleChannelClick() {
404-
this.$emit('show-channel-details', this.channelId);
416+
if (!this.isInChannelList) {
417+
this.$emit('show-channel-details', this.channelId);
418+
}
405419
},
406420
trackTokenCopy() {
407421
this.$analytics.trackAction('channel_list', 'Copy token', {

0 commit comments

Comments
 (0)