fix: cannot unassign user
This commit is contained in:
parent
827c221ad7
commit
6a127bb0bc
@ -9,7 +9,7 @@
|
||||
label: __('Cancel'),
|
||||
variant: 'subtle',
|
||||
onClick: () => {
|
||||
assignees = oldAssignees
|
||||
assignees = [...oldAssignees]
|
||||
show = false
|
||||
},
|
||||
},
|
||||
@ -20,6 +20,11 @@
|
||||
},
|
||||
],
|
||||
}"
|
||||
@close="
|
||||
() => {
|
||||
assignees = [...oldAssignees]
|
||||
}
|
||||
"
|
||||
>
|
||||
<template #body-content>
|
||||
<Link
|
||||
@ -76,8 +81,7 @@ import UserAvatar from '@/components/UserAvatar.vue'
|
||||
import Link from '@/components/Controls/Link.vue'
|
||||
import { usersStore } from '@/stores/users'
|
||||
import { Tooltip, call } from 'frappe-ui'
|
||||
import { ref, computed } from 'vue'
|
||||
import { watchOnce } from '@vueuse/core'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
doc: {
|
||||
@ -106,7 +110,7 @@ const { getUser } = usersStore()
|
||||
|
||||
const removeValue = (value) => {
|
||||
assignees.value = assignees.value.filter(
|
||||
(assignee) => assignee.name !== value
|
||||
(assignee) => assignee.name !== value,
|
||||
)
|
||||
}
|
||||
|
||||
@ -135,13 +139,13 @@ function updateAssignees() {
|
||||
}
|
||||
const removedAssignees = oldAssignees.value
|
||||
.filter(
|
||||
(assignee) => !assignees.value.find((a) => a.name === assignee.name)
|
||||
(assignee) => !assignees.value.find((a) => a.name === assignee.name),
|
||||
)
|
||||
.map((assignee) => assignee.name)
|
||||
|
||||
const addedAssignees = assignees.value
|
||||
.filter(
|
||||
(assignee) => !oldAssignees.value.find((a) => a.name === assignee.name)
|
||||
(assignee) => !oldAssignees.value.find((a) => a.name === assignee.name),
|
||||
)
|
||||
.map((assignee) => assignee.name)
|
||||
|
||||
@ -177,7 +181,7 @@ function updateAssignees() {
|
||||
show.value = false
|
||||
}
|
||||
|
||||
watchOnce(assignees, (value) => {
|
||||
oldAssignees.value = [...value]
|
||||
onMounted(() => {
|
||||
oldAssignees.value = [...assignees.value]
|
||||
})
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user