From 149b1db38c1a89d18657f610ba85f6cbecf196b8 Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sat, 13 Jun 2026 16:42:24 +0200 Subject: [PATCH 1/2] fix(mod-tools): default-sanction sent the topic array index, not the topic id sendDefaultSanction passed `selectedTopic` (the index into the topics array) as the CFH topic id to DefaultSanctionMessageComposer, so the emulator applied the default sanction against whatever topic happened to sit at that array position. The sibling sendSanction (and the topic label) correctly use `topics[selectedTopic].id`. Pass `category.id`, and move the `category` lookup after the `selectedTopic === -1` guard (+ a `!category` guard). --- .../mod-tools/views/user/ModToolsUserModActionView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/mod-tools/views/user/ModToolsUserModActionView.tsx b/src/components/mod-tools/views/user/ModToolsUserModActionView.tsx index 76c265f..6a82f09 100644 --- a/src/components/mod-tools/views/user/ModToolsUserModActionView.tsx +++ b/src/components/mod-tools/views/user/ModToolsUserModActionView.tsx @@ -75,14 +75,16 @@ export const ModToolsUserModActionView: FC = pro { if(isSendingRef.current) return; + if(selectedTopic === -1) return sendAlert(LocalizeText('modtools.user.modaction.error.no.topic')); + const category = topics[selectedTopic]; - if(selectedTopic === -1) return sendAlert(LocalizeText('modtools.user.modaction.error.no.topic')); + if(!category) return sendAlert(LocalizeText('modtools.user.modaction.error.no.topic')); const messageOrDefault = (message.trim().length === 0) ? LocalizeText(`help.cfh.topic.${ category.id }`) : message; isSendingRef.current = true; - SendMessageComposer(new DefaultSanctionMessageComposer(user.userId, selectedTopic, messageOrDefault)); + SendMessageComposer(new DefaultSanctionMessageComposer(user.userId, category.id, messageOrDefault)); onCloseClick(); }; From ed5c9296a87d82d0cc7f9e1f7c0682619c1a20fa Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sat, 13 Jun 2026 16:42:32 +0200 Subject: [PATCH 2/2] fix(mod-tools): typos in moderation-action result alerts The ModeratorActionResultMessageEvent alerts (hardcoded, not LocalizeText) read "successfull" and "applying tht moderation action". Fix to "successful" / "the". --- src/hooks/mod-tools/useModTools.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/mod-tools/useModTools.ts b/src/hooks/mod-tools/useModTools.ts index 7001076..9b925ae 100644 --- a/src/hooks/mod-tools/useModTools.ts +++ b/src/hooks/mod-tools/useModTools.ts @@ -183,8 +183,8 @@ const useModToolsState = () => { const parser = event.getParser(); - if(parser.success) simpleAlert('Moderation action was successfull', NotificationAlertType.MODERATION, null, null, 'Success'); - else simpleAlert('There was a problem applying tht moderation action', NotificationAlertType.MODERATION, null, null, 'Error'); + if(parser.success) simpleAlert('Moderation action was successful', NotificationAlertType.MODERATION, null, null, 'Success'); + else simpleAlert('There was a problem applying the moderation action', NotificationAlertType.MODERATION, null, null, 'Error'); }); useMessageEvent(CfhTopicsInitEvent, event =>