fix(magic): robust hostname matching for current device detection
This commit is contained in:
parent
6b44fb2927
commit
81c516b831
@ -30,7 +30,7 @@ function normalizePlatform(value: string | null | undefined): ComputedDevice["pl
|
|||||||
}
|
}
|
||||||
|
|
||||||
function normalizeHostname(value: string): string {
|
function normalizeHostname(value: string): string {
|
||||||
return (value.toLowerCase().split(".")[0] ?? "").trim();
|
return (value.toLowerCase().split(".")[0] ?? "").replace(/[^a-z0-9]/g, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useDeviceStatus(
|
export function useDeviceStatus(
|
||||||
|
|||||||
@ -16,7 +16,7 @@ const IPHONE_POLL_INTERVAL = 5000;
|
|||||||
const DEVICE_REFRESH_INTERVAL = 30000;
|
const DEVICE_REFRESH_INTERVAL = 30000;
|
||||||
|
|
||||||
function normalizeHostname(value: string): string {
|
function normalizeHostname(value: string): string {
|
||||||
return (value.toLowerCase().split(".")[0] ?? "").trim();
|
return (value.toLowerCase().split(".")[0] ?? "").replace(/[^a-z0-9]/g, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useProtectionStatus() {
|
export function useProtectionStatus() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user