Skip to content

Commit

Permalink
Set shouldPush to false to reactions (#746)
Browse files Browse the repository at this point in the history
* Set shouldPush to false to reactions

* Create pink-trainers-itch.md
  • Loading branch information
rygine authored Dec 4, 2024
1 parent 5b3d404 commit c27eb2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-trainers-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@xmtp/content-type-reaction": patch
---

Set shouldPush to false to reactions
20 changes: 2 additions & 18 deletions content-types/content-type-reaction/src/Reaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,8 @@ describe("ReactionContentType", () => {
expect(messageContent.schema).toBe("shortcode");
});

it("has a proper shouldPush value based on content", () => {
it("has a proper shouldPush value", () => {
const codec = new ReactionCodec();

const addReaction: Reaction = {
action: "added",
content: "smile",
reference: "foo",
schema: "shortcode",
};

const removeReaction: Reaction = {
action: "removed",
content: "smile",
reference: "foo",
schema: "shortcode",
};

expect(codec.shouldPush(addReaction)).toBe(true);
expect(codec.shouldPush(removeReaction)).toBe(false);
expect(codec.shouldPush()).toBe(false);
});
});
4 changes: 2 additions & 2 deletions content-types/content-type-reaction/src/Reaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class ReactionCodec
}
}

shouldPush(content: Reaction): boolean {
return content.action === "added";
shouldPush(): boolean {
return false;
}
}

0 comments on commit c27eb2e

Please sign in to comment.