Skip to content

Commit

Permalink
Fix UI Not Updating Immediately After Pinning/Unpinning Messages (#654)
Browse files Browse the repository at this point in the history
* pin

* removed comment
  • Loading branch information
smritidoneria authored Jan 1, 2025
1 parent f6eaf87 commit f3b33bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react/src/views/Message/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ const Message = ({

const handlePinMessage = async (msg) => {
const isPinned = msg.pinned;
msg.pinned = !isPinned;
const pinOrUnpin = isPinned
? await RCInstance.unpinMessage(msg._id)
: await RCInstance.pinMessage(msg._id);
if (pinOrUnpin.error) {
msg.pinned = isPinned;
dispatchToastMessage({
type: 'error',
message: 'Error pinning message',
Expand Down

0 comments on commit f3b33bc

Please sign in to comment.