tao-shen Claude Opus 4.6 commited on
Commit
9af315c
Β·
1 Parent(s): 9fc4834

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>

Files changed (2) hide show
  1. Dockerfile +1 -1
  2. frontend/electron-standalone.html +7 -0
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # OpenClaw on Hugging Face Spaces β€” Pre-built image (v3.9)
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;