正常に切り替えできるように

This commit is contained in:
r-ca 2024-01-29 01:38:52 +09:00
parent 0735c90d5e
commit 331a520be0
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -133,10 +133,14 @@ public class LacertaApplyTagDialog extends DialogFragment {
}
private void applyChangeToVariable(boolean isChecked, String tagId) {
logger.debug("applyChangeToVariable", "isChecked: " + isChecked);
logger.debug("applyChangeToVariable", "tagId: " + tagId);
logger.debug("applyChangeToVariable", "this.registeredTags.size(): " + this.registeredTags.size());
logger.debug("applyChangeToVariable", "this.appliedTags.size(): " + this.appliedTags.size());
if (isChecked) {
this.registeredTags.stream().findAny().filter(tag -> tag.getId().equals(tagId)).ifPresent(tag -> this.appliedTags.add(tag));
this.registeredTags.stream().filter(tag -> tag.getId().equals(tagId)).findFirst().ifPresent(tag -> this.appliedTags.add(tag));
} else {
this.appliedTags.stream().findAny().filter(tag -> tag.getId().equals(tagId)).ifPresent(tag -> this.appliedTags.remove(tag));
this.appliedTags.stream().filter(tag -> tag.getId().equals(tagId)).findFirst().ifPresent(tag -> this.appliedTags.remove(tag));
}
}