From a54d5c9009e3cec97ed220cac000297848bbbac3 Mon Sep 17 00:00:00 2001 From: shats Date: Sun, 7 Dec 2025 13:34:29 +0700 Subject: [PATCH] fix: Adjust key parsing logic in EasySwitchManager to correctly split serverId and community by the first colon, ensuring accurate data handling for gateway assignments. --- frontend/src/EasySwitchManager.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/EasySwitchManager.jsx b/frontend/src/EasySwitchManager.jsx index 7808eac..d353e13 100644 --- a/frontend/src/EasySwitchManager.jsx +++ b/frontend/src/EasySwitchManager.jsx @@ -226,7 +226,11 @@ function EasySwitchManager() { const changesByServer = new Map(); changedEntries.forEach(([key, gateway]) => { - const [serverId, community] = key.split(':'); + // Разбиваем ключ по ПЕРВОМУ двоеточию, т.к. community содержит двоеточие (65001:120) + const firstColonIndex = key.indexOf(':'); + const serverId = key.substring(0, firstColonIndex); + const community = key.substring(firstColonIndex + 1); + if (!changesByServer.has(serverId)) { changesByServer.set(serverId, new Map()); }