Skip to content

Commit 173fbc7

Browse files
committed
Connecting Insights toggle innerText to toggle state
1 parent 4c4ced2 commit 173fbc7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

browser/components/smartwindow/content/smartwindow.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h4 id="toggle-insights-popover-title">Insights</h4>
109109
>
110110
</p>
111111
<div class="toggle-insights-switch-row">
112-
<span>On</span>
112+
<span id="toggle-insights-text">On</span>
113113
<button
114114
id="toggle-insights-switch"
115115
role="switch"

browser/components/smartwindow/content/smartwindow.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,7 @@ class SmartWindowPage {
23582358
const closeBtn = document.getElementById(
23592359
this.isSidebarMode ? "toggle-insights-back" : "toggle-insights-close"
23602360
);
2361+
const txt = document.getElementById('toggle-insights-text')
23612362
const sw = document.getElementById("toggle-insights-switch");
23622363

23632364
if (!btn || !pop || !sw) {
@@ -2380,6 +2381,7 @@ class SmartWindowPage {
23802381
this.useInsightsState = val;
23812382
this.applyInsightsToChat();
23822383
sw.setAttribute("aria-checked", String(val));
2384+
txt.innerText = val ? "On" : "Off";
23832385
sw.classList.toggle("on", val);
23842386
};
23852387

0 commit comments

Comments
 (0)