mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix(devices): unicode escape bug + onSuccess race + en locale + apiErr surface
Code-review follow-up on 321c65b.
- prettier ate the raw glyphs (✓/✕/✏️) in AdminUserDetail.tsx and emitted
\u2713 / \u2715 / \u270F\uFE0F as JSX text children. JSX does NOT
process \u… escapes inside element children, so admin users saw the
literal six-character strings on Save/Cancel/Rename buttons. Wrap each
glyph in a JS expression {'…'} so it survives both prettier and JSX.
- renameDeviceMutation.onSuccess on Subscription.tsx no longer
unconditionally clears the edit state. If the user already navigated
to a different device while the previous save was in flight, we keep
their in-progress input. Same shape applied to AdminUserDetail.tsx —
the alias is snapshot before the await so a race can't smuggle the
wrong value into the request, and the post-success reset is guarded.
- AdminUserDetail rename error path now surfaces the backend's
response.data.detail (e.g. '64-char limit' message) instead of the
generic localized userActions.error toast.
- Add the new rename i18n keys to src/locales/en.json so English users
no longer fall back to Russian labels. ua/zh/fa to follow in a
dedicated translation pass.
This commit is contained in:
@@ -468,6 +468,11 @@
|
||||
"confirmDeleteAllDevices": "Delete all devices?",
|
||||
"deviceDeleted": "Device deleted",
|
||||
"allDevicesDeleted": "All devices deleted",
|
||||
"renameDevice": "Rename",
|
||||
"renameDeviceSave": "Save",
|
||||
"renameDeviceCancel": "Cancel",
|
||||
"renameDevicePlaceholder": "Device name",
|
||||
"deviceRenamed": "Device name updated",
|
||||
"platform": "Platform",
|
||||
"model": "Model",
|
||||
"connectedAt": "Connected",
|
||||
@@ -3176,7 +3181,10 @@
|
||||
"none": "No connected devices",
|
||||
"resetAll": "Reset all",
|
||||
"deleted": "Device removed",
|
||||
"allDeleted": "All devices reset"
|
||||
"allDeleted": "All devices reset",
|
||||
"rename": "Rename",
|
||||
"renameSave": "Save",
|
||||
"renamed": "Device name updated"
|
||||
},
|
||||
"referral": {
|
||||
"title": "Referral program",
|
||||
|
||||
Reference in New Issue
Block a user