Skip to content

Commit

Permalink
fix(Usage): do not show a blank screen while loading
Browse files Browse the repository at this point in the history
  • Loading branch information
benji6 committed Dec 6, 2023
1 parent ba6a3b8 commit 2972731
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions client/src/components/pages/About/Usage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export default function Usage() {
{ label: "More than a year ago", key: ">=365 days" },
] as const;

if (data === undefined || !("expires" in data) || !("usage" in data)) return;

const titleEl = <h2>Usage</h2>;

if (isPending)
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/shared/LocationString.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function LocationString({

if (isPending) return <Spinner inline />;
if (isError) return errorFallback ?? null;
const Place = data?.Results?.[0]?.Place;
const Place = data.Results?.[0]?.Place;
const locationName = Place?.Municipality ?? Place?.Label;
if (!locationName) {
captureException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function MoodCardWeather({ date, latitude, longitude }: Props) {
</div>
);

const weatherData = data!.data[0];
const weatherData = data.data[0];
const weatherIconData = weatherData?.weather[0];

const { iconName, weatherColor } = getWeatherDisplayData({
Expand Down

0 comments on commit 2972731

Please sign in to comment.