Skip to content

Commit 38e1645

Browse files
fix(mqtt): emit initial microphone state and drop redundant String() coercion
- speakingIndicator: move #emitMicrophoneState outside the state-change guard so the first detected state is published even when it matches the initial 'silent' value. Internal #lastEmittedState dedupe still prevents redundant IPC traffic. - mediaStatusService: drop String(state) since state is already a string, matching the PR description and updated docblock. Addresses Gemini review on PR #2497.
1 parent c0808b8 commit 38e1645

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/browser/tools/speakingIndicator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ class SpeakingIndicator {
217217
if (this.#overlayVisible) {
218218
this.#updateOverlay();
219219
}
220-
this.#emitMicrophoneState(newState);
221220
}
221+
this.#emitMicrophoneState(newState);
222222
});
223223

224224
if (foundAudioStats) {

app/mqtt/mediaStatusService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class MQTTMediaStatusService {
5858

5959
async #handleMicrophoneChanged(event, state) {
6060
const topic = `${this.#topicPrefix}/microphone`;
61-
await this.#mqttClient.publish(topic, String(state), { retain: true });
61+
await this.#mqttClient.publish(topic, state, { retain: true });
6262
console.debug('[MQTTMediaStatusService] Microphone state changed to', state, 'published to', topic);
6363
}
6464

0 commit comments

Comments
 (0)