Skip to content

Commit

Permalink
Merge branch '1078Fix' of https://github.com/CodeTappert/pokerogue in…
Browse files Browse the repository at this point in the history
…to pr/1122
  • Loading branch information
bennybroseph committed May 27, 2024
2 parents 034910a + a2c36dd commit f8abc4b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,9 @@ export function executeIf<T>(condition: boolean, promiseFunc: () => Promise<T>):

export const sessionIdKey = "pokerogue_sessionId";
// Check if the current hostname is 'localhost' or an IP address, and ensure a port is specified
export const isLocal = (
(window.location.hostname === "localhost" ||
/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/.test(window.location.hostname)) &&
window.location.port !== ""
) || window.location.hostname === "";
export const isLocal = ((window.location.hostname === "localhost" ||
/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/.test(window.location.hostname)) &&
window.location.port !== "") || window.location.hostname === "";

// Set the server URL based on whether it's local or not
export const serverUrl = isLocal ? `${window.location.hostname}:${window.location.port}` : "";
Expand Down

0 comments on commit f8abc4b

Please sign in to comment.