diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java index 3603ff12..02f935e2 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerManagerActivity.java @@ -164,10 +164,10 @@ public class ScannerManagerActivity extends AppCompatActivity { document.createDocument(documentMeta).thenAccept((documentDetail1) -> { Bitmap[] bitmaps = new Bitmap[this.croppedImages.size()]; this.croppedImages.toArray(bitmaps); - addPagesToDocumentDetail(documentDetail1, bitmaps).thenRun(() -> { - dialog.dismiss(); - finish(); - }); + addPagesToDocumentDetail(documentDetail1, bitmaps).join(); + document.updateDocument(documentDetail1).join(); + dialog.dismiss(); + finish(); }); } @@ -175,7 +175,7 @@ public class ScannerManagerActivity extends AppCompatActivity { private CompletableFuture addPagesToDocumentDetail(DocumentDetail documentDetail, Bitmap[] bitmaps) { return CompletableFuture.runAsync(() -> { try { - documentProcessorFactory.create(documentDetail).addNewPagesToLast(bitmaps); + document.updateDocument(documentProcessorFactory.create(documentDetail).addNewPagesToLast(bitmaps).getDocumentDetail()).join(); lacertaVcsFactory.create(documentDetail.getMeta().getId()).generateRevisionAtCurrent("Initial commit"); } catch (Exception e) { logger.error(TAG, "Error: " + e.getMessage()); diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java index 8898731a..87776426 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java @@ -119,6 +119,7 @@ public class DocumentImpl implements Document { @Override public CompletableFuture updateDocument(DocumentDetail detail) { return CompletableFuture.supplyAsync(() -> { + updateXmlMeta(detail).join(); return null; }); }