fix generation of reaction ids to support multiple reactions
This commit is contained in:
Vendored
+1
-1
@@ -747,7 +747,7 @@ body[showing-chat] #chat-page-wrapper {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.message-reaction-row {
|
.message-reaction-row {
|
||||||
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* src/View/ChatPages/taskPage.css */
|
/* src/View/ChatPages/taskPage.css */
|
||||||
|
|||||||
Vendored
+19
-1
@@ -1495,7 +1495,7 @@
|
|||||||
const fileContent = FileModel2.createFileContent(v4_default(), "reaction");
|
const fileContent = FileModel2.createFileContent(v4_default(), "reaction");
|
||||||
const reaction = {
|
const reaction = {
|
||||||
...fileContent,
|
...fileContent,
|
||||||
fileId: sender,
|
fileId: _ChatModel.createMessageReactionId(messageId, content, sender),
|
||||||
messageId,
|
messageId,
|
||||||
sender,
|
sender,
|
||||||
content,
|
content,
|
||||||
@@ -1504,7 +1504,25 @@
|
|||||||
return reaction;
|
return reaction;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
static {
|
||||||
|
this.createMessageReactionId = (messageId, content, sender) => {
|
||||||
|
console.log(reactionStringMap, content, reactionStringMap[content]);
|
||||||
|
return messageId + sender + reactionStringMap[content];
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var ReactionSymbols = /* @__PURE__ */ ((ReactionSymbols2) => {
|
||||||
|
ReactionSymbols2["ThumbsUp"] = "\u{1F44D}";
|
||||||
|
ReactionSymbols2["Check"] = "\u2705";
|
||||||
|
ReactionSymbols2["Attention"] = "\u2757\uFE0F";
|
||||||
|
ReactionSymbols2["DoubleAttention"] = "\u203C\uFE0F";
|
||||||
|
ReactionSymbols2["Question"] = "\u2753";
|
||||||
|
return ReactionSymbols2;
|
||||||
|
})(ReactionSymbols || {});
|
||||||
|
var reactionStringMap = {};
|
||||||
|
Object.entries(ReactionSymbols).forEach((value) => {
|
||||||
|
reactionStringMap[value[1]] = value[0];
|
||||||
|
});
|
||||||
var ChatInfoReference = {
|
var ChatInfoReference = {
|
||||||
dataVersion: DATA_VERSION,
|
dataVersion: DATA_VERSION,
|
||||||
primaryChannel: "",
|
primaryChannel: "",
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ export default class ChatModel {
|
|||||||
const fileContent = FileModel.createFileContent(v4(), "reaction");
|
const fileContent = FileModel.createFileContent(v4(), "reaction");
|
||||||
const reaction: ChatMessageReaction = {
|
const reaction: ChatMessageReaction = {
|
||||||
...fileContent,
|
...fileContent,
|
||||||
fileId: sender,
|
fileId: ChatModel.createMessageReactionId(messageId, content, sender),
|
||||||
|
|
||||||
messageId,
|
messageId,
|
||||||
sender,
|
sender,
|
||||||
@@ -426,6 +426,10 @@ export default class ChatModel {
|
|||||||
};
|
};
|
||||||
return reaction;
|
return reaction;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static createMessageReactionId = (messageId: string, content: ReactionSymbols, sender: string): string => {
|
||||||
|
return messageId + sender + reactionStringMap[content];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// types
|
// types
|
||||||
@@ -437,6 +441,11 @@ export enum ReactionSymbols {
|
|||||||
Question = "❓",
|
Question = "❓",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reactionStringMap: {[key: ReactionSymbols|string]: string} = {}
|
||||||
|
Object.entries(ReactionSymbols).forEach(value => {
|
||||||
|
reactionStringMap[value[1]] = value[0];
|
||||||
|
});
|
||||||
|
|
||||||
export interface ChatInfo extends ValidObject {
|
export interface ChatInfo extends ValidObject {
|
||||||
primaryChannel: string;
|
primaryChannel: string;
|
||||||
secondaryChannels: string[];
|
secondaryChannels: string[];
|
||||||
|
|||||||
Reference in New Issue
Block a user