Skip to content

Commit

Permalink
fix: breaking app when window not available on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhopperlowe committed Oct 25, 2024
1 parent 965090d commit 5d75b0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/admin/app/lib/model/oauthApps/providers/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const steps: OAuthFormStep<typeof schema.shape>[] = [
},
{
type: "copy",
text: BaseUrl,
text: BaseUrl(),
},

{
Expand Down
2 changes: 1 addition & 1 deletion ui/admin/app/lib/model/oauthApps/providers/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const steps: OAuthFormStep<typeof schema.shape>[] = [
},
{
type: "copy",
text: DomainUrl,
text: DomainUrl(),
},
{
type: "markdown",
Expand Down
12 changes: 10 additions & 2 deletions ui/admin/app/lib/routers/baseRouter.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
export const BaseUrl = window.location.origin + "/admin";
export const DomainUrl = window.location.origin;
export const BaseUrl = () => {
if (typeof window === "undefined") return "";

return window.location.origin + "/admin";
};
export const DomainUrl = () => {
if (typeof window === "undefined") return "";

return window.location.origin;
};

0 comments on commit 5d75b0d

Please sign in to comment.