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

View File

@@ -3,16 +3,19 @@
v-if='group', v-if='group',
@click.prevent='goToGroup' @click.prevent='goToGroup'
) {{group.name}} ) {{group.name}}
</template> </template>
<script> <script>
import { TAVERN_ID } from '../../common/script/constants';
export default { export default {
props: ['group'], props: ['group'],
methods: { methods: {
goToGroup () { goToGroup () {
if (this.group.type === 'party') { if (this.group.type === 'party') {
this.$router.push({name: 'party'}); this.$router.push({name: 'party'});
} else if (this.group._id === TAVERN_ID) {
this.$router.push({name: 'tavern'});
} else { } else {
this.$router.push({name: 'guild', params: {groupId: this.group._id}}); this.$router.push({name: 'guild', params: {groupId: this.group._id}});
} }