Fix crash when consecutive underscores are used in camera name

This commit is contained in:
Josh Hawkins 2024-11-29 10:08:47 -06:00
parent 2207a91f7b
commit 32db39fca8

View File

@ -62,6 +62,7 @@ function Live() {
if (selectedCameraName) { if (selectedCameraName) {
const capitalized = selectedCameraName const capitalized = selectedCameraName
.split("_") .split("_")
.filter((text) => text)
.map((text) => text[0].toUpperCase() + text.substring(1)); .map((text) => text[0].toUpperCase() + text.substring(1));
document.title = `${capitalized.join(" ")} - Live - Frigate`; document.title = `${capitalized.join(" ")} - Live - Frigate`;
} else if (cameraGroup && cameraGroup != "default") { } else if (cameraGroup && cameraGroup != "default") {