Browse Source

fix(roaming): translate and clarify the client-not-found kick message (#533) (#534)

Co-authored-by: gnacho <hnacho@proton.me>
Nacho 3 months ago
parent
commit
5dc073725a

+ 2 - 1
app/public/locales/en/translation.json

@@ -400,7 +400,8 @@
     "kick": {
       "title": "Kick from AP to force reconnection",
       "label": "Kick {{name}}",
-      "error": "Could not kick the client"
+      "error": "Could not kick the client",
+      "notFound": "is no longer connected to any access point: it may have disconnected or roamed off the network. The list refreshes automatically."
     },
     "dot11r": {
       "title": "802.11r status",

+ 2 - 1
app/public/locales/es/translation.json

@@ -400,7 +400,8 @@
     "kick": {
       "title": "Expulsar del AP para forzar reconexión",
       "label": "Expulsar a {{name}}",
-      "error": "No se pudo expulsar al cliente"
+      "error": "No se pudo expulsar al cliente",
+      "notFound": "ya no está conectado a ningún punto de acceso: puede que se haya desconectado o movido a otra red. La lista se refresca sola."
     },
     "dot11r": {
       "title": "Estado 802.11r",

+ 5 - 1
app/src/pages/Roaming.tsx

@@ -360,7 +360,11 @@ export default function Roaming() {
         let msg = t('roaming.kick.error')
         try {
           const j = (await res.json()) as { error?: string; message?: string }
-          if (j.message) msg = j.message
+          if (res.status === 404 || j.error === 'not_found') {
+            // #533: el cliente ya no está en ningún AP (se desconectó o se
+            // movió): mensaje propio traducido, no el crudo del backend.
+            msg = t('roaming.kick.notFound')
+          } else if (j.message) msg = j.message
           else if (j.error) msg = j.error
         } catch { /* si el body no es JSON, usamos el mensaje por defecto */ }
         setKickError(`${nameByMac.get(mac) ?? mac}: ${msg}`)