Spaces:
Runtime error
Runtime error
fix: sync language toggle button state on page load
Browse files- EN/δΈζ toggle now reflects saved chatLang from localStorage on init
- Prevents mismatch where buttons show EN active but content is in Chinese
- Force rebuild (v4.0)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Dockerfile +1 -1
- frontend/electron-standalone.html +7 -0
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# OpenClaw on Hugging Face Spaces β Pre-built image (
|
| 2 |
# Uses official pre-built image to avoid 30+ minute builds on cpu-basic
|
| 3 |
|
| 4 |
# ββ Stage 1: Pull pre-built OpenClaw βββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 1 |
+
# OpenClaw on Hugging Face Spaces β Pre-built image (v4.0)
|
| 2 |
# Uses official pre-built image to avoid 30+ minute builds on cpu-basic
|
| 3 |
|
| 4 |
# ββ Stage 1: Pull pre-built OpenClaw βββββββββββββββββββββββββββββββββββββββββ
|
frontend/electron-standalone.html
CHANGED
|
@@ -5526,6 +5526,13 @@ function toggleBrokerPanel() {
|
|
| 5526 |
let chatLang = localStorage.getItem('chatLang') || 'en';
|
| 5527 |
// Sync uiLang to chatLang on init (single language toggle now)
|
| 5528 |
uiLang = chatLang;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5529 |
let chatlogCache = [];
|
| 5530 |
function setChatLang(lang) {
|
| 5531 |
chatLang = lang;
|
|
|
|
| 5526 |
let chatLang = localStorage.getItem('chatLang') || 'en';
|
| 5527 |
// Sync uiLang to chatLang on init (single language toggle now)
|
| 5528 |
uiLang = chatLang;
|
| 5529 |
+
// Sync toggle button state on load
|
| 5530 |
+
requestAnimationFrame(() => {
|
| 5531 |
+
const enBtn = document.getElementById('chatlog-lang-en');
|
| 5532 |
+
const zhBtn = document.getElementById('chatlog-lang-zh');
|
| 5533 |
+
if (enBtn) enBtn.style.opacity = chatLang === 'en' ? '1' : '0.4';
|
| 5534 |
+
if (zhBtn) zhBtn.style.opacity = chatLang === 'zh' ? '1' : '0.4';
|
| 5535 |
+
});
|
| 5536 |
let chatlogCache = [];
|
| 5537 |
function setChatLang(lang) {
|
| 5538 |
chatLang = lang;
|