commit 0fa2d8f518c47b1c77b3589ed347b4ea8400e2a1
parent 634aa6867df4e888b08a1f2c4049f14273816392
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Wed, 16 Oct 2024 20:39:47 -0700
Fix some server IDs not being unmapped when deleted
When pushing updates with the PATCH method the deleted object's IDs
would only be deleted if going backward in history, but they should
be deleted regardless of whether the server is going backward or
forward in history.
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/files/floorplans/floorplan/backend.js b/files/floorplans/floorplan/backend.js
@@ -738,12 +738,10 @@ export class FloorplanBackend {
let backend = this
return api.fetch("PATCH", this.endpoint, patch)
.then(function(data) {
- if (newpos < backend.serverPosition) {
- for (let i = 0; i < patch.length; ++i) {
- if (patch[i].op === "remove") {
- let id = parsePath(patch[i].path)
- backend.unmapID(id)
- }
+ for (let i = 0; i < patch.length; ++i) {
+ if (patch[i].op === "remove") {
+ let id = parsePath(patch[i].path)
+ backend.unmapID(id)
}
}