Skip to content

Commit 1004ef2

Browse files
committed
refactor: reference subdomain string from app.subdomain_name
1 parent 6d0558e commit 1004ef2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

site/src/modules/resources/AppLink/AppLink.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const AppLink: FC<AppLinkProps> = ({
4242
const host = proxy.preferredWildcardHostname;
4343
const [iconError, setIconError] = useState(false);
4444
const link = useAppLink(app, { agent, workspace });
45-
const subdomain = new URL(link.href).hostname.split(".")[0];
4645

4746
// canClick is ONLY false when it's a subdomain app and the admin hasn't
4847
// enabled wildcard access URL or the session token is being fetched.
@@ -82,7 +81,7 @@ export const AppLink: FC<AppLinkProps> = ({
8281
"Your admin has not configured subdomain application access";
8382
}
8483

85-
if (subdomain.length > 63) {
84+
if (app.subdomain_name && app.subdomain_name.length > 63) {
8685
icon = (
8786
<CircleAlertIcon
8887
aria-hidden="true"

0 commit comments

Comments
 (0)