fix(desktop): extract wake pause into a callback to satisfy the no-ref-mirror lint rule

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.
This commit is contained in:
teknium1 2026-07-27 15:04:10 -07:00
parent 7d951032b2
commit 56d9e3faf2
No known key found for this signature in database

View file

@ -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])