mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 07:37:55 -05:00
Fix to tools mode not being preselected when editing calendar event
This commit is contained in:
@@ -7,6 +7,7 @@ select
|
||||
"CalendarEvent"."tags",
|
||||
"CalendarEvent"."participantCount",
|
||||
"CalendarEvent"."toToolsEnabled",
|
||||
"CalendarEvent"."toToolsMode",
|
||||
"User"."id" as "authorId",
|
||||
exists (
|
||||
select
|
||||
|
||||
@@ -355,6 +355,7 @@ export function findById(id: CalendarEvent["id"]) {
|
||||
| "authorId"
|
||||
| "participantCount"
|
||||
| "toToolsEnabled"
|
||||
| "toToolsMode"
|
||||
> &
|
||||
Pick<CalendarEventDate, "startTime" | "eventId"> &
|
||||
Pick<
|
||||
|
||||
@@ -599,7 +599,9 @@ function TOToolsAndMapPool() {
|
||||
const [checked, setChecked] = React.useState(
|
||||
Boolean(eventToEdit?.toToolsEnabled)
|
||||
);
|
||||
const [mode, setMode] = React.useState<"ALL" | RankedModeShort>("ALL");
|
||||
const [mode, setMode] = React.useState<"ALL" | RankedModeShort>(
|
||||
eventToEdit?.toToolsMode ?? "ALL"
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -612,6 +614,7 @@ function TOToolsAndMapPool() {
|
||||
className="calendar-new__select"
|
||||
onChange={(e) => setMode(e.target.value as RankedModeShort)}
|
||||
name="toToolsMode"
|
||||
defaultValue={mode}
|
||||
>
|
||||
<option value="ALL">All modes</option>
|
||||
<option value="SZ">SZ only</option>
|
||||
|
||||
Reference in New Issue
Block a user