Skip to content

Commit 3702525

Browse files
committed
render fallback only if the owner exists
1 parent 514500e commit 3702525

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/layouts/Header/components/Navigator/Navigator.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,20 @@ function Navigator({ currentUser, hasRepoAccess }: NavigatorProps) {
108108
pageName = 'accountAdmin'
109109
}
110110

111-
return (
112-
<div className="flex items-center">
113-
<MyContextSwitcher pageName={pageName} />
114-
{isCurrentUserPartOfOrg === false ? (
115-
<Label variant="plain" className="ml-2 hidden sm:block">
116-
Viewing as visitor
117-
</Label>
118-
) : null}
119-
</div>
120-
)
111+
if (ownerData) {
112+
return (
113+
<div className="flex items-center">
114+
<MyContextSwitcher pageName={pageName} />
115+
{isCurrentUserPartOfOrg === false ? (
116+
<Label variant="plain" className="ml-2 hidden sm:block">
117+
Viewing as visitor
118+
</Label>
119+
) : null}
120+
</div>
121+
)
122+
}
123+
124+
return null
121125
}
122126

123127
export default Navigator

0 commit comments

Comments
 (0)