1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-18 23:07:45 +02:00

Handle sync when resource has been edited

This commit is contained in:
Laurent Cozic
2020-05-31 00:31:29 +01:00
parent 0e5a0fdbe5
commit 1852d9291d
7 changed files with 63 additions and 8 deletions

View File

@ -207,6 +207,9 @@ function shimInit() {
shim.updateResourceBlob = async function(resourceId, newBlobFilePath) {
const resource = await Resource.load(resourceId);
const readyStatus = await Resource.readyStatus(resourceId);
if (readyStatus !== 'ok') throw new Error(`Cannot set resource blob because resource is not ready. Status: ${readyStatus}`);
const fileStat = await shim.fsDriver().stat(newBlobFilePath);
await shim.fsDriver().copy(newBlobFilePath, Resource.fullPath(resource));