Use toRaw when calling Set.difference

Vue's proxy handling interferres with the new Set methods causing them
to throw a TypeError when used on Set objects that are replaced by
proxies. Workaround by dropping the proxy when using these.

See https://github.com/vuejs/core/issues/11398
This commit is contained in:
Hornwitser 2025-06-27 18:52:16 +02:00
parent 73b28834a1
commit da65103e05

View file

@ -191,7 +191,7 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
for (const id of this.serverSlotIds) {
this.schedule.eventSlots.get(id)!.discard();
}
for (const id of this.slotIds.difference(this.serverSlotIds)) {
for (const id of toRaw(this.slotIds).difference(this.serverSlotIds)) {
const slot = this.schedule.eventSlots.get(id)!;
slot.setEventId(slot.serverEventId);
}
@ -563,7 +563,7 @@ export class ClientScheduleShift extends ClientEntity<ApiScheduleShift> {
for (const id of this.serverSlotIds) {
this.schedule.shiftSlots.get(id)!.discard();
}
for (const id of this.slotIds.difference(this.serverSlotIds)) {
for (const id of toRaw(this.slotIds).difference(this.serverSlotIds)) {
const slot = this.schedule.shiftSlots.get(id)!;
slot.setShiftId(slot.serverShiftId);
}