mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix(tasks): force sync instead of explicitly clearing notif
This commit is contained in:
@@ -4,7 +4,6 @@ base-notification(
|
|||||||
:has-icon="false",
|
:has-icon="false",
|
||||||
:notification="notification",
|
:notification="notification",
|
||||||
@click="action",
|
@click="action",
|
||||||
ref="taskApprovalNotification",
|
|
||||||
)
|
)
|
||||||
div(slot="content")
|
div(slot="content")
|
||||||
div(v-html="notification.data.message")
|
div(v-html="notification.data.message")
|
||||||
@@ -16,8 +15,10 @@ base-notification(
|
|||||||
<script>
|
<script>
|
||||||
import BaseNotification from './base';
|
import BaseNotification from './base';
|
||||||
import { mapState } from 'client/libs/store';
|
import { mapState } from 'client/libs/store';
|
||||||
|
import sync from 'client/mixins/sync';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [sync],
|
||||||
props: ['notification', 'canRemove'],
|
props: ['notification', 'canRemove'],
|
||||||
components: {
|
components: {
|
||||||
BaseNotification,
|
BaseNotification,
|
||||||
@@ -49,7 +50,7 @@ export default {
|
|||||||
userId: this.notification.data.userId,
|
userId: this.notification.data.userId,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$refs.taskApprovalNotification.remove();
|
this.sync();
|
||||||
},
|
},
|
||||||
async needsWork () {
|
async needsWork () {
|
||||||
// Redirect users to the group tasks page if the notification doesn't have data
|
// Redirect users to the group tasks page if the notification doesn't have data
|
||||||
@@ -68,7 +69,7 @@ export default {
|
|||||||
userId: this.notification.data.userId,
|
userId: this.notification.data.userId,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$refs.taskApprovalNotification.remove();
|
this.sync();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -331,7 +331,6 @@ api.approveTask = {
|
|||||||
// Remove old notifications
|
// Remove old notifications
|
||||||
let approvalPromises = [];
|
let approvalPromises = [];
|
||||||
managers.forEach((manager) => {
|
managers.forEach((manager) => {
|
||||||
if (manager._id === task.group.approval.approvingUser) return;
|
|
||||||
let notificationIndex = manager.notifications.findIndex(function findNotification (notification) {
|
let notificationIndex = manager.notifications.findIndex(function findNotification (notification) {
|
||||||
return notification && notification.data && notification.data.taskId === task._id && notification.type === 'GROUP_TASK_APPROVAL';
|
return notification && notification.data && notification.data.taskId === task._id && notification.type === 'GROUP_TASK_APPROVAL';
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user