this didnt happen shh

This commit is contained in:
Layne 2022-03-23 03:21:12 -04:00
parent 1c8c404d3e
commit 9b8f4e514e

View File

@ -58,7 +58,10 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = pro
const sendDefaultSanction = () =>
{
let errorMessage: string = null;
const category = topics[selectedTopic];
if(selectedTopic === -1) errorMessage = 'You must select a CFH topic';
if(errorMessage) return sendAlert(errorMessage);
const messageOrDefault = (message.trim().length === 0) ? LocalizeText(`help.cfh.topic.${category.id}`) : message;
SendMessageComposer(new DefaultSanctionMessageComposer(user.userId, selectedTopic, messageOrDefault));
onCloseClick();