Use shallowReactive() for attachment objects

For issue #664
This commit is contained in:
N-Pex 2025-07-16 15:47:39 +02:00
parent 621a53ae9e
commit c09043938a

View file

@ -17,7 +17,7 @@ import {
import proofmode from "../plugins/proofmode";
import imageSize from "image-size";
import imageResize from "image-resize";
import { computed, Reactive, reactive, ref, Ref } from "vue";
import { computed, Reactive, reactive, ref, Ref, shallowReactive } from "vue";
import utils, { THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_HEIGHT } from "@/plugins/utils";
export class AttachmentManager {
@ -55,7 +55,7 @@ export class AttachmentManager {
file: file,
useScaled: false,
};
const ra = reactive(a);
const ra = shallowReactive(a);
this.prepareUpload(ra);
return ra;
}
@ -199,7 +199,7 @@ export class AttachmentManager {
const fileSize = this.getSrcFileSize(event);
const attachment: Reactive<EventAttachment> = reactive({
const attachment: Reactive<EventAttachment> = shallowReactive({
event: event,
name: this.getFileName(event),
srcSize: fileSize,
@ -507,7 +507,7 @@ export const createUploadBatch = (
randomTranslationY: 0,
promise: undefined,
};
attachment.sendInfo = reactive(sendInfo);
attachment.sendInfo = shallowReactive(sendInfo);
});
const sendingPromise = utils