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",
:notification="notification",
@click="action",
ref="taskApprovalNotification",
)
div(slot="content")
div(v-html="notification.data.message")
@@ -16,8 +15,10 @@ base-notification(
<script>
import BaseNotification from './base';
import { mapState } from 'client/libs/store';
import sync from 'client/mixins/sync';
export default {
mixins: [sync],
props: ['notification', 'canRemove'],
components: {
BaseNotification,
@@ -49,7 +50,7 @@ export default {
userId: this.notification.data.userId,
});
this.$refs.taskApprovalNotification.remove();
this.sync();
},
async needsWork () {
// 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,
});
this.$refs.taskApprovalNotification.remove();
this.sync();
},
},
};

View File

@@ -331,7 +331,6 @@ api.approveTask = {
// Remove old notifications
let approvalPromises = [];
managers.forEach((manager) => {
if (manager._id === task.group.approval.approvingUser) return;
let notificationIndex = manager.notifications.findIndex(function findNotification (notification) {
return notification && notification.data && notification.data.taskId === task._id && notification.type === 'GROUP_TASK_APPROVAL';
});