Verified Commit c41f6f1c authored by Agate's avatar Agate 💬

Pretty URL for channels even if initially loaded with uuid

parent ad9a0030
Pipeline #9909 passed with stages
in 5 minutes and 38 seconds
......@@ -268,6 +268,15 @@ export default {
this.isLoading = true
let channelPromise = axios.get(`channels/${this.id}`).then(response => {
self.object = response.data
if (self.id == response.data.uuid && response.data.actor) {
// replace with the pretty channel url if possible
let actor = response.data.actor
if (actor.is_local) {
self.$router.replace({name: 'channels.detail', params: {id: actor.preferred_username}})
} else {
self.$router.replace({name: 'channels.detail', params: {id: actor.full_username}})
}
}
let tracksPromise = axios.get("tracks", {params: {channel: response.data.uuid, page_size: 1, playable: true, include_channels: true}}).then(response => {
self.totalTracks = response.data.count
self.isLoading = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment