From 56d9e3faf291d68d9bda145263440d3f4e49c1e4 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 27 Jul 2026 15:04:10 -0700 Subject: [PATCH] fix(desktop): extract wake pause into a callback to satisfy the no-ref-mirror lint rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wake-pause effect assigned wakePausedRef.current inside useEffect, tripping eslint's no-restricted-syntax guard against atom→ref mirroring. The ref is actually a request token (did WE issue wake.pause?), not a reactive mirror — moving the assignment into a pauseWakeForVoice callback keeps the semantics and passes the rule without a disable. --- .../chat/composer/hooks/use-composer-voice.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/app/chat/composer/hooks/use-composer-voice.ts b/apps/desktop/src/app/chat/composer/hooks/use-composer-voice.ts index c3b7b96249d..bc833d9f305 100644 --- a/apps/desktop/src/app/chat/composer/hooks/use-composer-voice.ts +++ b/apps/desktop/src/app/chat/composer/hooks/use-composer-voice.ts @@ -164,17 +164,23 @@ export function useComposerVoice({ .catch(() => undefined) }, []) + // The ref is a request token (did WE issue wake.pause?), not an atom mirror — + // it guards resumeWakeIfPaused from resuming a detector another surface owns. + const pauseWakeForVoice = useCallback(() => { + wakePausedRef.current = true + void $gateway + .get() + ?.request('wake.pause', {}) + .catch(() => undefined) + }, []) + useEffect(() => { if (voiceConversationActive) { - wakePausedRef.current = true - void $gateway - .get() - ?.request('wake.pause', {}) - .catch(() => undefined) + pauseWakeForVoice() } else { resumeWakeIfPaused() } - }, [resumeWakeIfPaused, voiceConversationActive]) + }, [pauseWakeForVoice, resumeWakeIfPaused, voiceConversationActive]) useEffect(() => resumeWakeIfPaused, [resumeWakeIfPaused])