mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-06 20:51:48 +02:00
🐛 Fix update options bug (#1116)
This commit is contained in:
parent
533e347557
commit
b55ebebda7
5 changed files with 9 additions and 5 deletions
|
@ -172,6 +172,12 @@ function createOptionsContextValue(
|
||||||
targetTimeZone: string,
|
targetTimeZone: string,
|
||||||
sourceTimeZone: string | null,
|
sourceTimeZone: string | null,
|
||||||
): OptionsContextValue {
|
): OptionsContextValue {
|
||||||
|
if (pollOptions.length === 0) {
|
||||||
|
return {
|
||||||
|
pollType: "date",
|
||||||
|
options: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
if (pollOptions[0].duration > 0) {
|
if (pollOptions[0].duration > 0) {
|
||||||
return {
|
return {
|
||||||
pollType: "timeSlot",
|
pollType: "timeSlot",
|
||||||
|
|
|
@ -54,7 +54,7 @@ const ParticipantRowForm = ({
|
||||||
<tr className={cn("group", className)}>
|
<tr className={cn("group", className)}>
|
||||||
<td
|
<td
|
||||||
style={{ minWidth: 240, maxWidth: 240 }}
|
style={{ minWidth: 240, maxWidth: 240 }}
|
||||||
className="sticky left-0 z-10 bg-white px-4"
|
className="sticky left-0 z-10 h-12 bg-white px-4"
|
||||||
>
|
>
|
||||||
<div className="flex items-center justify-between gap-x-2.5">
|
<div className="flex items-center justify-between gap-x-2.5">
|
||||||
{name ? (
|
{name ? (
|
||||||
|
|
|
@ -38,7 +38,7 @@ export const ParticipantRowView: React.FunctionComponent<{
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
style={{ minWidth: 240, maxWidth: 240 }}
|
style={{ minWidth: 240, maxWidth: 240 }}
|
||||||
className="sticky left-0 z-10 bg-white px-4"
|
className="sticky left-0 z-10 h-12 bg-white px-4"
|
||||||
>
|
>
|
||||||
<div className="flex max-w-full items-center justify-between gap-x-4">
|
<div className="flex max-w-full items-center justify-between gap-x-4">
|
||||||
<UserAvatar name={name} showName={true} isYou={isYou} />
|
<UserAvatar name={name} showName={true} isYou={isYou} />
|
||||||
|
|
|
@ -193,7 +193,6 @@ export const polls = router({
|
||||||
|
|
||||||
if (end) {
|
if (end) {
|
||||||
return {
|
return {
|
||||||
start: new Date(`${start}Z`),
|
|
||||||
startTime: input.timeZone
|
startTime: input.timeZone
|
||||||
? dayjs(start).tz(input.timeZone, true).toDate()
|
? dayjs(start).tz(input.timeZone, true).toDate()
|
||||||
: dayjs(start).utc(true).toDate(),
|
: dayjs(start).utc(true).toDate(),
|
||||||
|
@ -202,7 +201,6 @@ export const polls = router({
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
start: new Date(start.substring(0, 10) + "T00:00:00Z"),
|
|
||||||
startTime: dayjs(start).utc(true).toDate(),
|
startTime: dayjs(start).utc(true).toDate(),
|
||||||
pollId,
|
pollId,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue