mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-05-19 12:18:41 +00:00
Allow group links on challenge details to be opened in a new tab (#11889)
* - Use `router-link` in `groupLink` to make links that can be followed in a new tab * - Add back the missing `if` statement that was removed in error
This commit is contained in:
parent
b8c2d5eb20
commit
c00a1d74f9
1 changed files with 22 additions and 11 deletions
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<b-link
|
||||
<router-link
|
||||
v-if="group"
|
||||
@click.prevent="goToGroup"
|
||||
:to="toPath"
|
||||
>
|
||||
{{ group.name }}
|
||||
</b-link>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -12,15 +12,26 @@ import { TAVERN_ID } from '@/../../common/script/constants';
|
|||
|
||||
export default {
|
||||
props: ['group'],
|
||||
methods: {
|
||||
goToGroup () {
|
||||
if (this.group.type === 'party') {
|
||||
this.$router.push({ name: 'party' });
|
||||
} else if (this.group._id === TAVERN_ID) {
|
||||
this.$router.push({ name: 'tavern' });
|
||||
} else {
|
||||
this.$router.push({ name: 'guild', params: { groupId: this.group._id } });
|
||||
computed: {
|
||||
toPath () {
|
||||
if (this.group._id === TAVERN_ID) {
|
||||
return {
|
||||
name: 'tavern',
|
||||
};
|
||||
}
|
||||
|
||||
if (this.group.type === 'party') {
|
||||
return {
|
||||
name: 'party',
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: 'guild',
|
||||
params: {
|
||||
groupId: this.group._id,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue