Skip to content

Commit

Permalink
Fix issue: something went wrong with card color property
Browse files Browse the repository at this point in the history
  • Loading branch information
SNWCreations committed Jun 5, 2024
1 parent db93e65 commit f972be8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ public class CardComponentSerializer implements JsonSerializer<CardComponent>, J
public JsonElement serialize(CardComponent component, Type typeOfSrc, JsonSerializationContext context) {
JsonObject object = new JsonObject();
object.addProperty("type", "card");
object.addProperty("theme", component.getTheme().getValue());
object.addProperty("size", component.getSize().getValue());
if (component.getColor() != null && component.getColor().isEmpty()) {
if (component.getColor() != null && !component.getColor().isEmpty()) {
object.addProperty("color", component.getColor());
} else {
object.addProperty("theme", component.getTheme().getValue());
}
JsonArray modules = context.serialize(component.getModules()).getAsJsonArray();
object.add("modules", modules);
Expand Down

0 comments on commit f972be8

Please sign in to comment.