Skip to content

Commit

Permalink
Merge branch 'sabrecat/more-group-fixes' into delta
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreCat committed Aug 16, 2023
2 parents 04d97f4 + 58d58ff commit 6260b45
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "5.1.2",
"version": "5.1.3",
"main": "./website/server/index.js",
"dependencies": {
"@babel/core": "^7.22.5",
Expand Down
35 changes: 22 additions & 13 deletions website/client/src/components/avatar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div
v-if="member.preferences"
class="avatar"
:style="{width, height, paddingTop}"
:class="backgroundClass"
Expand Down Expand Up @@ -184,9 +185,11 @@ export default {
currentEventList: 'worldState.data.currentEventList',
}),
hasClass () {
if (!this.member) return false;
return this.$store.getters['members:hasClass'](this.member);
},
isBuffed () {
if (!this.member) return false;
return this.$store.getters['members:isBuffed'](this.member);
},
paddingTop () {
Expand All @@ -197,28 +200,30 @@ export default {
let val = '24px';
if (!this.avatarOnly) {
if (this.member.items.currentPet) val = '24px';
if (this.member.items.currentMount) val = '0px';
if (this.member?.items.currentPet) val = '24px';
if (this.member?.items.currentMount) val = '0px';
}
return val;
},
backgroundClass () {
const { background } = this.member.preferences;
if (this.member) {
const { background } = this.member.preferences;
const allowToShowBackground = !this.avatarOnly || this.withBackground;
const allowToShowBackground = !this.avatarOnly || this.withBackground;
if (this.overrideAvatarGear && this.overrideAvatarGear.background) {
return `background_${this.overrideAvatarGear.background}`;
}
if (this.overrideAvatarGear && this.overrideAvatarGear.background) {
return `background_${this.overrideAvatarGear.background}`;
}
if (background && allowToShowBackground) {
return `background_${this.member.preferences.background}`;
if (background && allowToShowBackground) {
return `background_${this.member.preferences.background}`;
}
}
return '';
},
visualBuffs () {
if (!this.member) return {};
return {
snowball: `avatar_snowball_${this.member.stats.class}`,
spookySparkles: 'ghost',
Expand All @@ -227,15 +232,16 @@ export default {
};
},
skinClass () {
if (!this.member) return '';
const baseClass = `skin_${this.member.preferences.skin}`;
return `${baseClass}${this.member.preferences.sleep ? '_sleep' : ''}`;
},
costumeClass () {
return this.member.preferences.costume ? 'costume' : 'equipped';
return this.member?.preferences.costume ? 'costume' : 'equipped';
},
specialMountClass () {
if (!this.avatarOnly && this.member.items.currentMount && this.member.items.currentMount.includes('Kangaroo')) {
if (!this.avatarOnly && this.member?.items.currentMount && this.member?.items.currentMount.includes('Kangaroo')) {
return 'offset-kangaroo';
}
Expand All @@ -248,12 +254,13 @@ export default {
)) {
return this.foolPet(this.member.items.currentPet);
}
if (this.member.items.currentPet) return `Pet-${this.member.items.currentPet}`;
if (this.member?.items.currentPet) return `Pet-${this.member.items.currentPet}`;
return '';
},
},
methods: {
getGearClass (gearType) {
if (!this.member) return '';
let result = this.member.items.gear[this.costumeClass][gearType];
if (this.overrideAvatarGear && this.overrideAvatarGear[gearType]) {
Expand All @@ -263,6 +270,7 @@ export default {
return result;
},
hideGear (gearType) {
if (!this.member) return true;
if (gearType === 'weapon') {
const equippedWeapon = this.member.items.gear[this.costumeClass][gearType];
Expand All @@ -288,6 +296,7 @@ export default {
this.$root.$emit('castEnd', this.member, 'user', e);
},
showAvatar () {
if (!this.member) return false;
if (!this.showVisualBuffs) return true;
const { buffs } = this.member.stats;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<challenge-modal
:group-id="groupId"
:group-id="group._id"
@createChallenge="challengeCreated"
/>
<div
Expand Down
4 changes: 2 additions & 2 deletions website/client/src/components/chat/chatMessages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
v-if="user._id !== msg.uuid && msg.uuid !== 'system'"
class="avatar-left"
:class="{ invisible: avatarUnavailable(msg) }"
:member="msg.userStyles || cachedProfileData[msg.uuid]"
:member="msg.userStyles || cachedProfileData[msg.uuid] || {}"
:avatar-only="true"
:hide-class-badge="true"
:override-top-padding="'14px'"
Expand All @@ -58,7 +58,7 @@
<avatar
v-if="user._id === msg.uuid"
:class="{ invisible: avatarUnavailable(msg) }"
:member="msg.userStyles || cachedProfileData[msg.uuid]"
:member="msg.userStyles || cachedProfileData[msg.uuid] || {}"
:avatar-only="true"
:hide-class-badge="true"
:override-top-padding="'14px'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default {
}
await this.$store.dispatch('guilds:join', { groupId: group.id, type: 'guild' });
this.$router.push({ name: 'guild', params: { groupId: group.id } });
this.$router.push({ name: 'groupPlanDetailTaskInformation', params: { groupId: group.id } });
},
reject () {
this.$store.dispatch('guilds:rejectInvite', { groupId: this.notification.data.id, type: 'guild' });
Expand Down
2 changes: 1 addition & 1 deletion website/common/locales/en/questsContent.json
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@
"dysheartenerArtCredit": "Artwork by @AnnDeLune",

"hugabugText": "Hug a Bug Quest Bundle",
"hugabugNotes": "Contains 'The CRITICAL BUG,' 'The Snail of Drudgery Sludge,' and 'Bye, Bye, Butterfry.' Available until March 31.",
"hugabugNotes": "Contains 'The CRITICAL BUG,' 'The Snail of Drudgery Sludge,' and 'Bye, Bye, Butterfry.' Available until August 31.",

"questSquirrelText": "The Sneaky Squirrel",
"questSquirrelNotes": "You wake up and find you’ve overslept! Why didn’t your alarm go off? … How did an acorn get stuck in the ringer?<br><br>When you try to make breakfast, the toaster is stuffed with acorns. When you go to retrieve your mount, @Shtut is there, trying unsuccessfully to unlock their stable. They look into the keyhole. “Is that an acorn in there?”<br><br>@randomdaisy cries out, “Oh no! I knew my pet squirrels had gotten out, but I didn’t know they’d made such trouble! Can you help me round them up before they make any more of a mess?”<br><br>Following the trail of mischievously placed oak nuts, you track and catch the wayward sciurines, with @Cantras helping secure each one safely at home. But just when you think your task is almost complete, an acorn bounces off your helm! You look up to see a mighty beast of a squirrel, crouched in defense of a prodigious pile of seeds.<br><br>“Oh dear,” says @randomdaisy, softly. “She’s always been something of a resource guarder. We’ll have to proceed very carefully!” You circle up with your party, ready for trouble!",
Expand Down
2 changes: 1 addition & 1 deletion website/common/locales/en/rebirth.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"rebirthOrb": "Used an Orb of Rebirth to start over after attaining Level <%= level %>.",
"rebirthOrb100": "Used an Orb of Rebirth to start over after attaining Level 100 or higher.",
"rebirthOrbNoLevel": "Used an Orb of Rebirth to start over.",
"rebirthPop": "Instantly restart your character as a Level 1 Warrior while retaining achievements, collectibles, and equipment. Your tasks and their history will remain but they will be reset to yellow. Your streaks will be removed except from tasks belonging to active Challenges and Group Plans. Your Gold, Experience, Mana, and the effects of all Skills will be removed. All of this will take effect immediately. For more information, see the wiki's <a href='https://habitica.fandom.com/wiki/Orb_of_Rebirth' target='_blank'>Orb of Rebirth</a> page.",
"rebirthPop": "Instantly restart your character as a Level 1 Warrior while retaining achievements, collectibles, and equipment. Your tasks and their history will remain but they will be reset to yellow. Your streaks will be removed except from tasks belonging to active Challenges and Group Plans. Your Gold, Experience, Mana, and the effects of all Skills will be removed. All of this will take effect immediately.",
"rebirthName": "Orb of Rebirth",
"rebirthComplete": "You have been reborn!",
"nextFreeRebirth": "<strong><%= days %> days</strong> until <strong>FREE</strong> Orb of Rebirth"
Expand Down
2 changes: 1 addition & 1 deletion website/common/script/content/hatching-potions.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ const premium = {
limited: true,
event: EVENTS.potions202308,
_addlNotes: t('eventAvailabilityReturning', {
availableDate: t('dateStartAugust'),
availableDate: t('dateEndAugust'),
previousDate: t('februaryYYYY', { year: 2022 }),
}),
canBuy () {
Expand Down
5 changes: 2 additions & 3 deletions website/server/controllers/api-v3/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,9 @@ api.getChallengeTasks = {
const group = await Group.getGroup({
user,
groupId: challenge.group,
fields: '_id type privacy',
optionalMembership: true,
fields: '_id type privacy purchased',
});
if (!group || !challenge.canView(user, group)) throw new NotFound(res.t('challengeNotFound'));
if (!group && !challenge.canView(user, group)) throw new NotFound(res.t('challengeNotFound'));

const tasks = await getTasks(req, res, { user, challenge });
return res.respond(200, tasks);
Expand Down

0 comments on commit 6260b45

Please sign in to comment.