Skip to content

Commit

Permalink
fix: nilcheck loader data (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamsjokvist authored Dec 28, 2023
1 parent 825aeec commit 48c8273
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tasks:
vars:
ldflags: -X 'main.isProduction="true"' -X 'main.appVersion=${APP_VERSION}' -X 'main.steamUsername=${STEAM_USERNAME}' -X 'main.steamPassword=${STEAM_PASSWORD}' -X 'main.capIDEmail=${CAP_ID_EMAIL}' -X 'main.capIDPassword=${CAP_ID_PASSWORD}'
cmds:
- cmd: env GOOS=darwin GOARCH=amd64 wails build -ldflags="{{.ldflags}}"
- cmd: env GOOS=darwin GOARCH=arm64 wails build -ldflags="{{.ldflags}}"
platforms: [darwin]
- cmd: GOOS=windows GOARCH=amd64 wails build -ldflags="{{.ldflags}}"
platforms: [windows]
2 changes: 1 addition & 1 deletion gui/src/pages/stats/matches-list-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { model } from "@@/go/models";

export const MatchesListPage: React.FC = () => {
const { t } = useTranslation();
const totalMatches = useLoaderData() as model.Match[];
const totalMatches = (useLoaderData() ?? []) as model.Match[];
const [matches, setMatches] = React.useState<model.Match[]>(totalMatches);
const [totalWinRate, setTotalWinRate] = React.useState<number | null>(null);

Expand Down
2 changes: 1 addition & 1 deletion gui/src/pages/stats/sessions-list-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type MonthGroup = Record<number, model.Session[]>;
type YearGroup = Record<number, MonthGroup>;

export const SessionsListPage: React.FC = () => {
const sessions = useLoaderData() as model.Session[];
const sessions = (useLoaderData() ?? []) as model.Session[];
const { i18n, t } = useTranslation();
const navigate = useNavigate();

Expand Down
2 changes: 1 addition & 1 deletion gui/src/pages/tracking/tracking-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { PageHeader } from "@/ui/page-header";

export const TrackingForm: React.FC = () => {
const { t } = useTranslation();
const users = useLoaderData() as model.User[]
const users = (useLoaderData() ?? []) as model.User[]
const trackingActor = TrackingMachineContext.useActorRef()

const playerIdInputRef = React.useRef<HTMLInputElement>(null);
Expand Down

0 comments on commit 48c8273

Please sign in to comment.