fix(tasks): force sync instead of explicitly clearing notif

This commit is contained in:
Sabe Jones
2019-04-17 09:05:23 -05:00
parent 4c832ad36c
commit 43b607aedd
2 changed files with 4 additions and 4 deletions

View File

@@ -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();
}, },
}, },
}; };

View File

@@ -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';
}); });