[bugfix] Fix the bugs:
A message resend/edit feature that was not working. Romaji didn't show up even when mouse hover at some point.
This commit is contained in:
@@ -17,10 +17,10 @@ export const MessageContainer = ({ messages, status, category, created_at }) =>
|
|||||||
const [is_locked, setIsLocked] = useState(false);
|
const [is_locked, setIsLocked] = useState(false);
|
||||||
|
|
||||||
const resendFunction = () => {
|
const resendFunction = () => {
|
||||||
sendMessage(messages.original);
|
sendMessage(messages.original.message);
|
||||||
};
|
};
|
||||||
const editFunction = () => {
|
const editFunction = () => {
|
||||||
updateMessageInputValue(messages.original);
|
updateMessageInputValue(messages.original.message);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleMouseEnter = () => {
|
const handleMouseEnter = () => {
|
||||||
@@ -94,19 +94,17 @@ const MessageWithTransliteration = ({ item }) => {
|
|||||||
const hira = token.hira ?? "";
|
const hira = token.hira ?? "";
|
||||||
const hepburn = token.hepburn ?? "";
|
const hepburn = token.hepburn ?? "";
|
||||||
|
|
||||||
if ((hira && orig === hira) || (hepburn && orig === hepburn) || (!hira && !hepburn)) {
|
if ((hira && orig === hira)) {
|
||||||
return (
|
return (
|
||||||
<span key={key} className={styles.token}>
|
<span key={key} title={hepburn} className={styles.token}>
|
||||||
{orig}
|
{orig}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hira && hira !== orig) {
|
if (hira && hira !== orig) {
|
||||||
const needHepburn = hepburn && hepburn !== orig;
|
|
||||||
const titleAttr = needHepburn ? hepburn : undefined;
|
|
||||||
return (
|
return (
|
||||||
<ruby key={key} title={titleAttr} className={styles.tokenRuby}>
|
<ruby key={key} title={hepburn} className={styles.tokenRuby}>
|
||||||
{orig}
|
{orig}
|
||||||
<rt>{hira}</rt>
|
<rt>{hira}</rt>
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const MessageInputBox = () => {
|
|||||||
if (currentMessageLogs.data) {
|
if (currentMessageLogs.data) {
|
||||||
const sentMessages = currentMessageLogs.data
|
const sentMessages = currentMessageLogs.data
|
||||||
.filter(log => log.category === "sent")
|
.filter(log => log.category === "sent")
|
||||||
.map(log => log.messages.original);
|
.map(log => log.messages.original.message);
|
||||||
setMessageHistory(sentMessages);
|
setMessageHistory(sentMessages);
|
||||||
}
|
}
|
||||||
}, [currentMessageLogs.data]);
|
}, [currentMessageLogs.data]);
|
||||||
|
|||||||
Reference in New Issue
Block a user