show reactions per user, allow only one reaction per message per user

This commit is contained in:
marlon-erler
2026-04-11 17:47:24 +00:00
parent a29cd023d5
commit cad4ebfdd4
8 changed files with 130 additions and 176 deletions
+2 -12
View File
@@ -416,11 +416,7 @@ export default class ChatModel {
const fileContent = FileModel.createFileContent(v4(), "reaction");
const reaction: ChatMessageReaction = {
...fileContent,
fileId: ChatModel.createMessageReactionId(
messageId,
content,
sender,
),
fileId: ChatModel.createMessageReactionId(messageId, sender),
messageId,
sender,
@@ -432,10 +428,9 @@ export default class ChatModel {
static createMessageReactionId = (
messageId: string,
content: ReactionSymbols,
sender: string,
): string => {
return messageId + sender + reactionStringMap[content];
return messageId + sender;
};
}
@@ -449,11 +444,6 @@ export enum ReactionSymbols {
Question = "❓",
}
const reactionStringMap: { [key: ReactionSymbols | string]: string } = {};
Object.entries(ReactionSymbols).forEach((value) => {
reactionStringMap[value[1]] = value[0];
});
export interface ChatInfo extends ValidObject {
primaryChannel: string;
secondaryChannels: string[];