[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:
Sakamoto Shiina
2025-09-17 23:32:35 +09:00
parent 7274c514a7
commit 17e450310e
2 changed files with 6 additions and 8 deletions

View File

@@ -17,10 +17,10 @@ export const MessageContainer = ({ messages, status, category, created_at }) =>
const [is_locked, setIsLocked] = useState(false);
const resendFunction = () => {
sendMessage(messages.original);
sendMessage(messages.original.message);
};
const editFunction = () => {
updateMessageInputValue(messages.original);
updateMessageInputValue(messages.original.message);
};
const handleMouseEnter = () => {
@@ -94,19 +94,17 @@ const MessageWithTransliteration = ({ item }) => {
const hira = token.hira ?? "";
const hepburn = token.hepburn ?? "";
if ((hira && orig === hira) || (hepburn && orig === hepburn) || (!hira && !hepburn)) {
if ((hira && orig === hira)) {
return (
<span key={key} className={styles.token}>
<span key={key} title={hepburn} className={styles.token}>
{orig}
</span>
);
}
if (hira && hira !== orig) {
const needHepburn = hepburn && hepburn !== orig;
const titleAttr = needHepburn ? hepburn : undefined;
return (
<ruby key={key} title={titleAttr} className={styles.tokenRuby}>
<ruby key={key} title={hepburn} className={styles.tokenRuby}>
{orig}
<rt>{hira}</rt>
</ruby>

View File

@@ -33,7 +33,7 @@ export const MessageInputBox = () => {
if (currentMessageLogs.data) {
const sentMessages = currentMessageLogs.data
.filter(log => log.category === "sent")
.map(log => log.messages.original);
.map(log => log.messages.original.message);
setMessageHistory(sentMessages);
}
}, [currentMessageLogs.data]);