fix reporting

This commit is contained in:
dank074 2022-11-15 19:57:48 -06:00
parent e589fb7539
commit 5e3483645d
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
import { GetCfhStatusMessageComposer } from '@nitrots/nitro-renderer';
import { FC } from 'react';
import { DispatchUiEvent, LocalizeText, ReportState, SendMessageComposer } from '../../../api';
import { DispatchUiEvent, LocalizeText, ReportState, ReportType, SendMessageComposer } from '../../../api';
import { Button, Column, Text } from '../../../common';
import { GuideToolEvent } from '../../../events';
import { useHelp } from '../../../hooks';
@ -14,8 +14,9 @@ export const HelpIndexView: FC<{}> = props =>
setActiveReport(prevValue =>
{
const currentStep = ReportState.SELECT_USER;
const reportType = ReportType.BULLY;
return { ...prevValue, currentStep };
return { ...prevValue, currentStep, reportType };
});
}

View File

@ -22,13 +22,13 @@ export const SelectReportedUserView: FC<{}> = props =>
return Array.from(users.values());
}, [ chatHistory ]);
const submitUser = () =>
const submitUser = (userId: number) =>
{
if(selectedUserId <= 0) return;
if(userId <= 0) return;
setActiveReport(prevValue =>
{
return { ...prevValue, reportedUserId: selectedUserId, currentStep: ReportState.SELECT_CHATS };
return { ...prevValue, reportedUserId: userId, currentStep: ReportState.SELECT_CHATS };
});
}
@ -76,7 +76,7 @@ export const SelectReportedUserView: FC<{}> = props =>
<Button variant="secondary" onClick={ back }>
{ LocalizeText('generic.back') }
</Button>
<Button disabled={ (selectedUserId <= 0) } onClick={ submitUser }>
<Button disabled={ (selectedUserId <= 0) } onClick={ () => submitUser(selectedUserId) }>
{ LocalizeText('help.emergency.main.submit.button') }
</Button>
</Flex>