Skip to content

Commit

Permalink
chore: return if info is not loaded in app layout (#287)
Browse files Browse the repository at this point in the history
* chore: return if info is not loaded in app layout

* chore: return null
  • Loading branch information
im-adithya authored Jul 19, 2024
1 parent 7d2fefc commit a48001e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/components/layouts/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export default function AppLayout() {

const isHttpMode = window.location.protocol.startsWith("http");

if (!info) {
return null;
}

function UserMenuContent() {
return (
<DropdownMenuContent align="end">
Expand Down Expand Up @@ -184,7 +188,7 @@ export default function AppLayout() {
}

const upToDate =
info?.version &&
info.version &&
albyMe?.hub.latest_version &&
info.version.startsWith("v") &&
info.version.substring(1) >= albyMe?.hub.latest_version;
Expand All @@ -210,7 +214,7 @@ export default function AppLayout() {
className="font-semibold text-xl"
>
<span className="text-xs flex items-center text-muted-foreground">
{info?.version && <>{info?.version}&nbsp;</>}
{info.version && <>{info.version}&nbsp;</>}
{upToDate ? (
<ShieldCheckIcon className="w-4 h-4" />
) : (
Expand Down

0 comments on commit a48001e

Please sign in to comment.