Skip to content

Commit

Permalink
Set logged in user name as default event creator
Browse files Browse the repository at this point in the history
  • Loading branch information
Alf-Melmac committed Mar 9, 2024
1 parent 728dde8 commit c8ffc4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/event/wizard/EventWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {EventWizardSteps} from './EventWizardSteps';
import {useEventCopy} from './useEventCopy';
import {useTranslatedDocumentTitle} from '../../../hooks/useTranslatedDocumentTitle';
import {getTimeShort} from '../../../utils/dateHelper';
import {useAuth} from '../../../contexts/authentication/AuthProvider';

export type EventWizardLocation = {
copy: EventDetailsDto['id'];
Expand All @@ -29,14 +30,15 @@ export function EventWizard(): JSX.Element {
const [active, setActive] = useState(0);

const date = new Date();
const {user} = useAuth();
const form = useEventWizardForm({
initialValues: {
hidden: false,
shareable: true,
name: '',
date: date,
startTime: getTimeShort(date),
creator: '',
creator: user?.name ?? '',
eventType: {
name: '',
color: randomColor(),
Expand Down

0 comments on commit c8ffc4c

Please sign in to comment.