mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Fix issues with task scoring and in-app-reward retrieval (#15294)
* remove obsolete class and computed * correctly load equipped gear * load purchased for in app rewards
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="notifications"
|
class="notifications"
|
||||||
:class="notificationsTopPosClass"
|
|
||||||
:style="{'--current-scrollY': notificationTopY}"
|
:style="{'--current-scrollY': notificationTopY}"
|
||||||
>
|
>
|
||||||
<transition-group
|
<transition-group
|
||||||
@@ -104,7 +103,6 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
notificationStore: 'notificationStore',
|
notificationStore: 'notificationStore',
|
||||||
userSleeping: 'user.data.preferences.sleep',
|
|
||||||
currentEventList: 'worldState.data.currentEventList',
|
currentEventList: 'worldState.data.currentEventList',
|
||||||
}),
|
}),
|
||||||
currentEvent () {
|
currentEvent () {
|
||||||
@@ -113,18 +111,6 @@ export default {
|
|||||||
isEventActive () {
|
isEventActive () {
|
||||||
return Boolean(this.currentEvent?.event);
|
return Boolean(this.currentEvent?.event);
|
||||||
},
|
},
|
||||||
notificationsTopPosClass () {
|
|
||||||
const base = 'notifications-top-pos-';
|
|
||||||
let modifier = '';
|
|
||||||
|
|
||||||
if (this.userSleeping) {
|
|
||||||
modifier = 'sleeping';
|
|
||||||
} else {
|
|
||||||
modifier = 'normal';
|
|
||||||
}
|
|
||||||
|
|
||||||
return `${base}${modifier} scroll-${this.scrollY}`;
|
|
||||||
},
|
|
||||||
notificationBannerHeight () {
|
notificationBannerHeight () {
|
||||||
let scrollPosToCheck = 56;
|
let scrollPosToCheck = 56;
|
||||||
|
|
||||||
|
|||||||
@@ -751,7 +751,7 @@ api.updateTask = {
|
|||||||
api.scoreTask = {
|
api.scoreTask = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/tasks/:taskId/score/:direction',
|
url: '/tasks/:taskId/score/:direction',
|
||||||
middlewares: [authWithHeaders({ userFieldsToInclude: ['stats', 'guilds', 'items.equipped', 'items.eggs', 'items.food', 'items.hatchingPotions', 'items.lastDrop', 'items.quests', 'achievements', 'tasksOrder', 'webhooks', 'party'] })],
|
middlewares: [authWithHeaders({ userFieldsToInclude: ['stats', 'guilds', 'items.gear.equipped', 'items.eggs', 'items.food', 'items.hatchingPotions', 'items.lastDrop', 'items.quests', 'achievements', 'tasksOrder', 'webhooks', 'party'] })],
|
||||||
async handler (req, res) {
|
async handler (req, res) {
|
||||||
// Parameters are validated in scoreTasks
|
// Parameters are validated in scoreTasks
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ api.getBuyList = {
|
|||||||
*/
|
*/
|
||||||
api.getInAppRewardsList = {
|
api.getInAppRewardsList = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
middlewares: [authWithHeaders({ userFieldsToInclude: ['items', 'pinnedItems', 'unpinnedItems', 'pinnedItemsOrder', 'stats.class', 'achievements'] })],
|
middlewares: [authWithHeaders({ userFieldsToInclude: ['items', 'pinnedItems', 'unpinnedItems', 'pinnedItemsOrder', 'stats.class', 'achievements', 'purchased'] })],
|
||||||
url: '/user/in-app-rewards',
|
url: '/user/in-app-rewards',
|
||||||
async handler (req, res) {
|
async handler (req, res) {
|
||||||
const list = common.inAppRewards(res.locals.user);
|
const list = common.inAppRewards(res.locals.user);
|
||||||
|
|||||||
Reference in New Issue
Block a user