You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have develop a sketch plugin to upload sketch file to the web server right after the document has been saved
but I found when I run upload method in the callback of document.save, sometimes it upload the original document which is unsaved, then I run some test
let fileData = fs.readFileSync(decodeURIComponent(document.path));
console.log("1:" + fileData.length);
//do some actions
//eg. delete some pages
....
//save the document
document.save(err => {
fileData = fs.readFileSync(decodeURIComponent(document.path));
console.log("2:" + fileData.length);
setTimeout(() => {
fileData = fs.readFileSync(decodeURIComponent(document.path));
console.log("3:" + fileData.length);
}, 4000)
})
It seems the data length(1 and 2) is actually the same right after the save callback is running, after a 4000ms time out(3) ,the file data is actually changed.
But I think the document is supposed to change right after the callback has been executed
The text was updated successfully, but these errors were encountered:
I have develop a sketch plugin to upload sketch file to the web server right after the document has been saved
but I found when I run upload method in the callback of document.save, sometimes it upload the original document which is unsaved, then I run some test
It seems the data length(1 and 2) is actually the same right after the save callback is running, after a 4000ms time out(3) ,the file data is actually changed.
But I think the document is supposed to change right after the callback has been executed
The text was updated successfully, but these errors were encountered: