Merge pull request #242 from simoleo89/fix/modtools-bugs

fix(mod-tools): default-sanction topic id & alert typos
This commit is contained in:
DuckieTM
2026-06-15 07:15:52 +02:00
committed by GitHub
2 changed files with 6 additions and 4 deletions
@@ -75,14 +75,16 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = 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();
};
+2 -2
View File
@@ -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>(CfhTopicsInitEvent, event =>