Added Tavern case

This commit is contained in:
Marvin Rabe
2018-05-07 13:35:53 +02:00
parent 4c837acf88
commit c83499545c
2 changed files with 9 additions and 2 deletions

View File

@@ -14,7 +14,7 @@
.owner-item
strong {{ $t('createdBy') }}:
user-link.mx-1(:user="challenge.leader")
.owner-item(v-if="challenge.group && challenge.group.name !== 'Tavern'")
.owner-item(v-if="challenge.group && !isTavern(challenge.group)")
strong {{ $t(challenge.group.type) }}:
group-link.mx-1(:group="challenge.group")
.meta
@@ -212,6 +212,7 @@
</style>
<script>
import { TAVERN_ID } from '../../../common/script/constants';
import {mapState} from 'client/libs/store';
import userLink from '../userLink';
import groupLink from '../groupLink';
@@ -265,6 +266,9 @@
isOfficial (category) {
return category.name === 'habitica_official';
},
isTavern (group) {
return group._id === TAVERN_ID;
},
},
};
</script>

View File

@@ -3,16 +3,19 @@
v-if='group',
@click.prevent='goToGroup'
) {{group.name}}
</template>
<script>
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}});
}