mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 15:36:18 +00:00
Merge pull request #242 from simoleo89/fix/modtools-bugs
fix(mod-tools): default-sanction topic id & alert typos
This commit is contained in:
@@ -75,14 +75,16 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = pro
|
|||||||
{
|
{
|
||||||
if(isSendingRef.current) return;
|
if(isSendingRef.current) return;
|
||||||
|
|
||||||
|
if(selectedTopic === -1) return sendAlert(LocalizeText('modtools.user.modaction.error.no.topic'));
|
||||||
|
|
||||||
const category = topics[selectedTopic];
|
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;
|
const messageOrDefault = (message.trim().length === 0) ? LocalizeText(`help.cfh.topic.${ category.id }`) : message;
|
||||||
|
|
||||||
isSendingRef.current = true;
|
isSendingRef.current = true;
|
||||||
SendMessageComposer(new DefaultSanctionMessageComposer(user.userId, selectedTopic, messageOrDefault));
|
SendMessageComposer(new DefaultSanctionMessageComposer(user.userId, category.id, messageOrDefault));
|
||||||
onCloseClick();
|
onCloseClick();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -183,8 +183,8 @@ const useModToolsState = () =>
|
|||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
if(parser.success) simpleAlert('Moderation action was successfull', NotificationAlertType.MODERATION, null, null, 'Success');
|
if(parser.success) simpleAlert('Moderation action was successful', NotificationAlertType.MODERATION, null, null, 'Success');
|
||||||
else simpleAlert('There was a problem applying tht moderation action', NotificationAlertType.MODERATION, null, null, 'Error');
|
else simpleAlert('There was a problem applying the moderation action', NotificationAlertType.MODERATION, null, null, 'Error');
|
||||||
});
|
});
|
||||||
|
|
||||||
useMessageEvent<CfhTopicsInitEvent>(CfhTopicsInitEvent, event =>
|
useMessageEvent<CfhTopicsInitEvent>(CfhTopicsInitEvent, event =>
|
||||||
|
|||||||
Reference in New Issue
Block a user