Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix update options bug #1116

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/web/src/components/poll-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ function createOptionsContextValue(
targetTimeZone: string,
sourceTimeZone: string | null,
): OptionsContextValue {
if (pollOptions.length === 0) {
return {
pollType: "date",
options: [],
};
}
if (pollOptions[0].duration > 0) {
return {
pollType: "timeSlot",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/poll/desktop-poll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ const DesktopPoll: React.FunctionComponent = () => {
"scrollbar-thin hover:scrollbar-thumb-gray-400 scrollbar-thumb-gray-300 scrollbar-track-gray-100 relative z-10 flex-grow overflow-auto scroll-smooth",
)}
>
<table className="w-full table-auto border-separate border-spacing-0 ">
<table className="w-full table-auto border-separate border-spacing-0 ">
<thead>
<PollHeader />
</thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ParticipantRowForm = ({
<tr className={cn("group", className)}>
<td
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">
{name ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const ParticipantRowView: React.FunctionComponent<{
>
<td
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">
<UserAvatar name={name} showName={true} isYou={isYou} />
Expand Down
2 changes: 0 additions & 2 deletions packages/backend/trpc/routers/polls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ export const polls = router({

if (end) {
return {
start: new Date(`${start}Z`),
startTime: input.timeZone
? dayjs(start).tz(input.timeZone, true).toDate()
: dayjs(start).utc(true).toDate(),
Expand All @@ -202,7 +201,6 @@ export const polls = router({
};
} else {
return {
start: new Date(start.substring(0, 10) + "T00:00:00Z"),
startTime: dayjs(start).utc(true).toDate(),
pollId,
};
Expand Down
Loading