This commit is contained in:
r-ca 2024-01-29 01:07:41 +09:00
parent efdf9c1fea
commit 68dddbabee
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -142,24 +142,22 @@ public class LacertaApplyTagDialog extends DialogFragment {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList = new ArrayList<>(); ArrayList<DocumentTagApplyTagDialogExtendedModel> documentTagArrayList = new ArrayList<>();
setRegisteredTagList().join(); setRegisteredTagList().thenRun(() -> setAppliedTagList(documentId)).thenAccept(Void -> {
setAppliedTagList(documentId).join(); logger.debug("getDocumentTagArrayList", "this.registeredTags.size(): " + this.registeredTags.size());
logger.debug("getDocumentTagArrayList", "this.appliedTags.size(): " + this.appliedTags.size());
logger.debug("getDocumentTagArrayList", "this.registeredTags.size(): " + this.registeredTags.size()); for (int i = 0; i < this.registeredTags.size(); i++) {
logger.debug("getDocumentTagArrayList", "this.appliedTags.size(): " + this.appliedTags.size()); boolean isChecked = false;
for (int j = 0; j < this.appliedTags.size(); j++) {
for (int i = 0; i < this.registeredTags.size(); i++) { if (this.registeredTags.get(i).getId().equals(this.appliedTags.get(j).getId())) {
boolean isChecked = false; isChecked = true;
for (int j = 0; j < this.appliedTags.size(); j++) { break;
if (this.registeredTags.get(i).getId().equals(this.appliedTags.get(j).getId())) { }
isChecked = true;
break;
} }
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel(
new DocumentTag(this.registeredTags.get(i).getId(), this.registeredTags.get(i).getName(), this.registeredTags.get(i).getColor()), isChecked));
} }
documentTagArrayList.add(new DocumentTagApplyTagDialogExtendedModel( }).join();
new DocumentTag(this.registeredTags.get(i).getId(), this.registeredTags.get(i).getName(), this.registeredTags.get(i).getColor()), isChecked));
}
return documentTagArrayList; return documentTagArrayList;
}); });
} }
@ -167,7 +165,11 @@ public class LacertaApplyTagDialog extends DialogFragment {
private CompletableFuture<Void> setAppliedTagList(String documentId) { private CompletableFuture<Void> setAppliedTagList(String documentId) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> { lacertaLibrary.getAppliedTagList(documentId).thenAccept(documentTags -> {
this.appliedTags = documentTags; if (documentTags == null) {
this.appliedTags = new ArrayList<>();
} else {
this.appliedTags = documentTags;
}
}); });
return null; return null;
}); });