mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-20 07:10:02 +00: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
|
export let create: ObjectCreate | undefined = undefined
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
let _space = space
|
let oldSpace = space
|
||||||
$: if (_space !== space) {
|
$: if (oldSpace !== space) {
|
||||||
_space = space
|
oldSpace = space
|
||||||
dispatch('change', space)
|
dispatch('change', space)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -101,9 +101,13 @@
|
|||||||
object.visibility = visibility
|
object.visibility = visibility
|
||||||
}
|
}
|
||||||
|
|
||||||
async function spaceChange (space: Ref<Space>) {
|
async function spaceChange (space: Space | null) {
|
||||||
await client.update(object, { attachedSpace: space })
|
const oldSpace = object.attachedSpace ?? undefined
|
||||||
object.attachedSpace = space
|
const newSpace = space?._id ?? undefined
|
||||||
|
if (newSpace !== oldSpace) {
|
||||||
|
await client.update(object, { attachedSpace: newSpace })
|
||||||
|
object.attachedSpace = newSpace
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -171,7 +175,7 @@
|
|||||||
autoSelect={false}
|
autoSelect={false}
|
||||||
readonly={object._class === time.class.ProjectToDo}
|
readonly={object._class === time.class.ProjectToDo}
|
||||||
space={object.attachedSpace}
|
space={object.attachedSpace}
|
||||||
on:change={(e) => spaceChange(e.detail)}
|
on:object={(e) => spaceChange(e.detail)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user