mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
UBERF-5886: fix todo reorder on click (#4904)
Signed-off-by: Eduard Aksamitov <e@euaaaio.ru>
This commit is contained in:
parent
5ce079cf3d
commit
6eefe88b60
@ -42,9 +42,9 @@
|
||||
|
||||
export let create: ObjectCreate | undefined = undefined
|
||||
const dispatch = createEventDispatcher()
|
||||
let _space = space
|
||||
$: if (_space !== space) {
|
||||
_space = space
|
||||
let oldSpace = space
|
||||
$: if (oldSpace !== space) {
|
||||
oldSpace = space
|
||||
dispatch('change', space)
|
||||
}
|
||||
</script>
|
||||
|
@ -101,9 +101,13 @@
|
||||
object.visibility = visibility
|
||||
}
|
||||
|
||||
async function spaceChange (space: Ref<Space>) {
|
||||
await client.update(object, { attachedSpace: space })
|
||||
object.attachedSpace = space
|
||||
async function spaceChange (space: Space | null) {
|
||||
const oldSpace = object.attachedSpace ?? undefined
|
||||
const newSpace = space?._id ?? undefined
|
||||
if (newSpace !== oldSpace) {
|
||||
await client.update(object, { attachedSpace: newSpace })
|
||||
object.attachedSpace = newSpace
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -171,7 +175,7 @@
|
||||
autoSelect={false}
|
||||
readonly={object._class === time.class.ProjectToDo}
|
||||
space={object.attachedSpace}
|
||||
on:change={(e) => spaceChange(e.detail)}
|
||||
on:object={(e) => spaceChange(e.detail)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user