fix(magic): robust hostname matching for current device detection

This commit is contained in:
chahinebrini 2026-06-17 02:52:00 +02:00
parent 6b44fb2927
commit 81c516b831
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ function normalizePlatform(value: string | null | undefined): ComputedDevice["pl
}
function normalizeHostname(value: string): string {
return (value.toLowerCase().split(".")[0] ?? "").trim();
return (value.toLowerCase().split(".")[0] ?? "").replace(/[^a-z0-9]/g, "");
}
export function useDeviceStatus(

View File

@ -16,7 +16,7 @@ const IPHONE_POLL_INTERVAL = 5000;
const DEVICE_REFRESH_INTERVAL = 30000;
function normalizeHostname(value: string): string {
return (value.toLowerCase().split(".")[0] ?? "").trim();
return (value.toLowerCase().split(".")[0] ?? "").replace(/[^a-z0-9]/g, "");
}
export function useProtectionStatus() {