Revert "🐛 Fix time zone reset when replacing all options (#1221)" (#1227)

This commit is contained in:
Luke Vella 2024-07-29 14:07:45 +01:00 committed by GitHub
parent 737d6e73ed
commit 5a785a5317
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 47 additions and 47 deletions

View file

@ -18,7 +18,6 @@ import { PollSettingsForm } from "@/components/forms/poll-settings";
import { Trans } from "@/components/trans";
import { useUser } from "@/components/user-provider";
import { setCookie } from "@/utils/cookies";
import { getBrowserTimeZone } from "@/utils/date-time-utils";
import { usePostHog } from "@/utils/posthog";
import { trpc } from "@/utils/trpc/client";
@ -48,8 +47,6 @@ export const CreatePoll: React.FunctionComponent = () => {
description: "",
location: "",
view: "month",
autoTimeZone: true,
timeZone: user.timeZone || getBrowserTimeZone(),
options: [],
hideScores: false,
hideParticipants: false,
@ -79,13 +76,13 @@ export const CreatePoll: React.FunctionComponent = () => {
<form
onSubmit={form.handleSubmit(async (formData) => {
const title = required(formData?.title);
const isFullDay = formData?.options?.[0]?.type === "date";
await createPoll.mutateAsync(
{
title: title,
location: formData?.location,
description: formData?.description,
timeZone: !isFullDay ? formData?.timeZone : undefined,
timeZone: formData?.timeZone,
hideParticipants: formData?.hideParticipants,
disableComments: formData?.disableComments,
hideScores: formData?.hideScores,