Skip to content

Commit

Permalink
this is actually not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
leijurv committed Jul 9, 2019
1 parent 419b128 commit e56b23b
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,34 +64,14 @@ public void addOrMutate(String name, String version) {

Optional<String> id = findProfileIdFromName(name);
if (!id.isPresent()) { // Create mode
if (profiles.has(name)) {
profiles.remove(name); // just in case (shouldn't happen)

}

profiles.add(name, profile = new JsonObject());
profile.addProperty("name", name);
} else { // Mutate mode
profile = profiles.get(id.get()).getAsJsonObject();
}
if (profile.has("lastUsed")) {
profile.remove("lastUsed");
}
profile.addProperty("lastUsed", dateFormat.format(new Date())); // always bump.

if (profile.has("lastVersionId")) {
profile.remove("lastVersionId");
}
profile.addProperty("lastVersionId", version);

if (profile.has("icon")) {
profile.remove("icon");
}
profile.addProperty("icon", ICON);

if (profile.has("type")) {
profile.remove("type");
}
profile.addProperty("type", "custom");
}

Expand Down

0 comments on commit e56b23b

Please sign in to comment.