fix pageIndex pb

This commit is contained in:
isUnknown 2024-11-19 17:01:58 +01:00
parent 8b9bd9e4ab
commit 5f5c53e284
3 changed files with 35 additions and 13 deletions

View file

@ -118,7 +118,7 @@ import { useRoute } from "vue-router";
dayjs.locale("fr");
const emits = defineEmits(["show-draft-bubble", "hide-draft-bubble"]);
const emits = defineEmits(["show-draft-marker"]);
const { user } = useUserStore();
const { page } = usePageStore();
@ -153,11 +153,8 @@ watch(isAddOpen, (newVal) => {
watch(
draftComment,
(newVal) => {
console.log(newVal.position);
if (newVal.position) {
emits("show-draft-bubble", newVal);
} else {
emits("hide-draft-bubble");
emits("show-draft-marker", newVal);
}
},
{ deep: true }
@ -188,7 +185,7 @@ function handleSubmit(event = null) {
date,
position:
{
pageIndex: draftComment.value.pageIndex,
pageIndex: draftComment.value.position.pageIndex,
x: draftComment.value.position?.x,
y: draftComment.value.position?.y,
} ?? false,