From bf58f25cd58a1ec9c7be48cd38d84b67d27189a2 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 29 Jan 2024 00:35:51 +0900 Subject: [PATCH] =?UTF-8?q?AppliedTag=E3=82=92=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E5=A4=89=E6=95=B0=E3=81=A7=E6=8C=81=E3=81=A4=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/common/LacertaApplyTagDialog.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 aefa9cf6..14508239 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 @@ -49,6 +49,7 @@ public class LacertaApplyTagDialog extends DialogFragment { private String negativeButtonText; private String documentId; private LacertaApplyTagDialogListener listener; + private ArrayList appliedTags; // Setter @@ -133,11 +134,11 @@ public class LacertaApplyTagDialog extends DialogFragment { return CompletableFuture.supplyAsync(() -> { ArrayList documentTagArrayList = new ArrayList<>(); lacertaLibrary.getTagList().thenAccept(documentTags -> { - ArrayList appliedTags = lacertaLibrary.getAppliedTagList(documentId).join(); + setAppliedTagList(documentId); for (int i = 0; i < documentTags.size(); i++) { boolean isChecked = false; - for (int j = 0; j < appliedTags.size(); j++) { - if (documentTags.get(i).getId().equals(appliedTags.get(j).getId())) { + for (int j = 0; j < this.appliedTags.size(); j++) { + if (documentTags.get(i).getId().equals(this.appliedTags.get(j).getId())) { isChecked = true; break; } @@ -151,4 +152,10 @@ public class LacertaApplyTagDialog extends DialogFragment { }); } + private void setAppliedTagList(String documentId) { + lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> { + this.appliedTags = documentTags; + }); + } + }