Fix: probably partial fix of #2407

This commit is contained in:
Pieter Vander Vennet 2025-05-13 22:55:54 +02:00
parent 7b466a1d53
commit 68d96063ac

View file

@ -28,7 +28,18 @@
if (featureId == "*") {
return input.map((inp) => inp.length)
}
return input.map((success) => success.filter((item) => item === featureId).length)
return input.map((ids) => {
// 'input' contains all the ids of the _features_ for which images are being uploaded
// This id can be the temporary id (e.g. node/-1) or the new id
// We thus have to check the remappings!
const remappings = state.changes._changesetHandler._remappings
const remappedFeatureId = remappings.get(featureId) ?? featureId
return ids.filter((itemId) => itemId === featureId ||
itemId === remappedFeatureId ||
(remappings.get(itemId) ?? itemId === featureId) ||
(remappings.get(itemId) ?? itemId === remappedFeatureId)).length
})
}
let successfull = getCount(state.imageUploadManager.successfull)