Bug fix: save on no changes
Some checks failed
Create Release on Tag Push / build (push) Has been cancelled
Some checks failed
Create Release on Tag Push / build (push) Has been cancelled
This commit is contained in:
parent
0bc89f4a72
commit
f2801c9f1c
2 changed files with 17 additions and 3 deletions
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue