JoinGroup: set tutorial join date

This commit is contained in:
Liam Fitzgerald 2021-03-03 13:17:27 +10:00 committed by Jimmy Young
parent 7fc52405ce
commit 180ea74e51

View File

@ -22,6 +22,7 @@ import { StatelessAsyncButton } from '~/views/components/StatelessAsyncButton';
import { getModuleIcon } from '~/logic/lib/util'; import { getModuleIcon } from '~/logic/lib/util';
import { FormError } from '~/views/components/FormError'; import { FormError } from '~/views/components/FormError';
import { GroupSummary } from './GroupSummary'; import { GroupSummary } from './GroupSummary';
import {TUTORIAL_GROUP_RESOURCE} from '~/logic/lib/tutorialModal';
const formSchema = Yup.object({ const formSchema = Yup.object({
group: Yup.string() group: Yup.string()
@ -72,6 +73,9 @@ export function JoinGroup(props: JoinGroupProps): ReactElement {
const onConfirm = useCallback(async (group: string) => { const onConfirm = useCallback(async (group: string) => {
const [,,ship,name] = group.split('/'); const [,,ship,name] = group.split('/');
if(group === TUTORIAL_GROUP_RESOURCE) {
await api.settings.putEntry('tutorial', 'joined', Date.now());
}
await api.groups.join(ship, name); await api.groups.join(ship, name);
try { try {
await waiter((p: JoinGroupProps) => { await waiter((p: JoinGroupProps) => {