diff --git a/client/scripts/controllers/server/reactions.ts b/client/scripts/controllers/server/reactions.ts index c773964b10e..697e913d5ea 100644 --- a/client/scripts/controllers/server/reactions.ts +++ b/client/scripts/controllers/server/reactions.ts @@ -20,6 +20,7 @@ const modelFromServer = (reaction) => { reaction.reaction, reaction.thread_id, reaction.comment_id, + reaction.Address.chain, ); }; diff --git a/client/scripts/models/OffchainReaction.ts b/client/scripts/models/OffchainReaction.ts index eff14bc4eb7..fd0fb266d0d 100644 --- a/client/scripts/models/OffchainReaction.ts +++ b/client/scripts/models/OffchainReaction.ts @@ -8,8 +8,9 @@ class OffchainReaction { public readonly reaction: string; public readonly threadId: number | string; public readonly commentId: number | string; + public readonly author_chain: string; - constructor(id, author, chain, community, reaction, threadId, communityId) { + constructor(id, author, chain, community, reaction, threadId, communityId, author_chain) { this.id = id; this.author = author; this.chain = chain; @@ -17,6 +18,7 @@ class OffchainReaction { this.reaction = reaction; this.threadId = threadId; this.commentId = communityId; + this.author_chain = author_chain; } } diff --git a/client/scripts/views/components/reaction_button.ts b/client/scripts/views/components/reaction_button.ts index 1361a7d092e..fb1e6f825ec 100644 --- a/client/scripts/views/components/reaction_button.ts +++ b/client/scripts/views/components/reaction_button.ts @@ -43,7 +43,7 @@ const ReactionButton: m.Component = { if (hasReacted) hasReactedType = rxn.reaction; const reactors = (likes || dislikes).slice(0, MAX_VISIBLE_REACTING_ACCOUNTS).map((rxn_) => { - return m('.reacting-user', m(User, { user: [rxn_.author, app.activeChainId()], linkify: true })); + return m('.reacting-user', m(User, { user: [rxn_.author, rxn_.author_chain], linkify: true })); }); if (reactors.length < (likes || dislikes).length) { const diff = (likes || dislikes).length - reactors.length; @@ -58,6 +58,7 @@ const ReactionButton: m.Component = { e.preventDefault(); e.stopPropagation(); if (disabled) return; + // if it's a community use the app.vm.activeAccount.chain.id instead of author chain const chainId = app.activeCommunityId() ? null : app.activeChainId(); const communityId = app.activeCommunityId(); if (hasReacted) {