mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-16 21:32:18 +02:00
Added window.location.hostname === ''; back as a check
This commit is contained in:
parent
cc9c4dcaf1
commit
061f190797
@ -216,9 +216,11 @@ export function executeIf<T>(condition: boolean, promiseFunc: () => Promise<T>):
|
|||||||
|
|
||||||
export const sessionIdKey = 'pokerogue_sessionId';
|
export const sessionIdKey = 'pokerogue_sessionId';
|
||||||
// Check if the current hostname is 'localhost' or an IP address, and ensure a port is specified
|
// Check if the current hostname is 'localhost' or an IP address, and ensure a port is specified
|
||||||
export const isLocal = (window.location.hostname === 'localhost' ||
|
export const isLocal = (
|
||||||
|
(window.location.hostname === 'localhost' ||
|
||||||
/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/.test(window.location.hostname)) &&
|
/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/.test(window.location.hostname)) &&
|
||||||
window.location.port !== '';
|
window.location.port !== ''
|
||||||
|
) || window.location.hostname === '';
|
||||||
|
|
||||||
// Set the server URL based on whether it's local or not
|
// Set the server URL based on whether it's local or not
|
||||||
export const serverUrl = isLocal ? `${window.location.hostname}:${window.location.port}` : '';
|
export const serverUrl = isLocal ? `${window.location.hostname}:${window.location.port}` : '';
|
||||||
|
Loading…
Reference in New Issue
Block a user