mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
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:
parent
7d951032b2
commit
56d9e3faf2
1 changed files with 12 additions and 6 deletions
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue