Bug fix: save on no changes
Some checks failed
Create Release on Tag Push / build (push) Has been cancelled

This commit is contained in:
MassiveBox 2025-04-06 12:21:25 +02:00
parent 0bc89f4a72
commit f2801c9f1c
Signed by: massivebox
GPG key ID: 9B74D3A59181947D
2 changed files with 17 additions and 3 deletions

View file

@ -50,6 +50,7 @@ export async function replaceSyncID(fileID: string, oldSyncID: string, newSyncID
const search = encodeURI(IDsToAssetPath(fileID, oldSyncID)); // the API uses URI-encoded
// find blocks containing that image
const blocks = await findImageBlocks(search);
if(blocks.length === 0) return false;
for(const block of blocks) {
@ -62,8 +63,11 @@ export async function replaceSyncID(fileID: string, oldSyncID: string, newSyncID
for(const source of sources) {
const newSource = IDsToAssetPath(fileID, newSyncID);
await replaceBlockContent(block.id, source, newSource);
const changed = await replaceBlockContent(block.id, source, newSource);
if(!changed) return false
}
}
return true;
}