Skip to content

Commit

Permalink
fix: the reaction codec crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 13, 2023
1 parent e3b7cf2 commit 440c005
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class ContentJson(
val reaction = obj.get("reaction").asJsonObject
return ContentJson(ContentTypeReaction, Reaction(
reference = reaction.get("reference").asString,
action = ReactionAction.valueOf(reaction.get("action").asString),
schema = ReactionSchema.valueOf(reaction.get("schema").asString),
action = ReactionAction.valueOf(reaction.get("action").asString.lowercase()),
schema = ReactionSchema.valueOf(reaction.get("schema").asString.lowercase()),
content = reaction.get("content").asString,
))
} else if (obj.has("reply")) {
Expand Down
4 changes: 2 additions & 2 deletions src/XMTP.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export type ReplyContent = {

export type ReactionContent = {
reference: string;
action: "added" | "removed";
schema: "unicode" | "shortcode" | "custom";
action: "added" | "removed" | "unknown";
schema: "unicode" | "shortcode" | "custom" | "unknown";
content: string;
};

Expand Down

0 comments on commit 440c005

Please sign in to comment.