One small change

This commit is contained in:
2025-10-09 21:20:08 -06:00
parent 6a39d23f28
commit ad8723b8fe
3 changed files with 13 additions and 7 deletions

View File

@@ -558,9 +558,15 @@ struct AddEditProblemView: View {
// Save new image data and combine with existing paths
var allImagePaths = imagePaths
for data in imageData {
if let relativePath = ImageManager.shared.saveImageData(data) {
allImagePaths.append(relativePath)
// Only save NEW images (those beyond the existing imagePaths count)
let newImagesStartIndex = imagePaths.count
if imageData.count > newImagesStartIndex {
for i in newImagesStartIndex..<imageData.count {
let data = imageData[i]
if let relativePath = ImageManager.shared.saveImageData(data) {
allImagePaths.append(relativePath)
}
}
}