Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<VDivider />
<p class="mt-4 text-xs-center">
<KButton
href="/channels"
href="/channels/#public"
:text="$tr('guestModeLink')"
appearance="basic-link"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@
},
watch: {
$route(route) {
if (this.loggedIn && route.name === RouteNames.CHANNELS_EDITABLE) {
this.loadInvitationList();
if (route.name === RouteNames.CHANNELS_EDITABLE) {
this.loggedIn
? this.loadInvitationList()
: this.$router.replace({ name: RouteNames.CATALOG_ITEMS });
}
if (this.fullPageError) {
this.$store.dispatch('errors/clearError');
Expand All @@ -250,10 +252,12 @@
created() {
if (this.loggedIn) {
this.loadInvitationList();
} else if (!CATALOG_PAGES.includes(this.$route.name)) {
this.$router.push({
name: RouteNames.CATALOG_ITEMS,
});
} else {
if (this.$route.name === RouteNames.CHANNELS_EDITABLE) {
this.$router.replace({ name: RouteNames.CATALOG_ITEMS });
} else if (!CATALOG_PAGES.includes(this.$route.name)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CATALOG_PAGES, which is defined in this file, does not include RouteNames.CHANNELS_EDITABLE.

As I alluded to before, the this.$router.push does not fit with the expected behavior in the issue. So given what CATALOG_PAGES contains, this can be reduced to only changing push to replace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CATALOG_PAGES, which is defined in this file, does not include RouteNames.CHANNELS_EDITABLE.

As I alluded to before, the this.$router.push does not fit with the expected behavior in the issue. So given what CATALOG_PAGES contains, this can be reduced to only changing push to replace

@bjester , I have added route.replace there as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for changing it to replace.

Now, given what I said previously about CATALOG_PAGES, how are the if-statement conditions different? It seems to me !CATALOG_PAGES.includes(this.$route.name) is true at the same time as this.$route.name === RouteNames.CHANNELS_EDITABLE is true

this.$router.replace({ name: RouteNames.CATALOG_ITEMS });
}
}
},
mounted() {
Expand Down