diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java index 14508239..596a2d01 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java @@ -18,6 +18,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; import javax.inject.Inject; @@ -49,6 +50,7 @@ public class LacertaApplyTagDialog extends DialogFragment { private String negativeButtonText; private String documentId; private LacertaApplyTagDialogListener listener; + private ArrayList registeredTags; private ArrayList appliedTags; // Setter @@ -152,9 +154,17 @@ public class LacertaApplyTagDialog extends DialogFragment { }); } - private void setAppliedTagList(String documentId) { - lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> { - this.appliedTags = documentTags; + private CompletableFuture setAppliedTagList(String documentId) { + return CompletableFuture.runAsync(() -> { + lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> { + this.appliedTags = documentTags; + }); + }); + } + + private void setRegisteredTagList() { + lacertaLibrary.getTagList().thenAccept(documentTags -> { + this.registeredTags = documentTags; }); }