-
Notifications
You must be signed in to change notification settings - Fork 588
mic-stopped-peding #5034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
mic-stopped-peding #5034
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { useListener } from "~/stt/contexts"; | ||
|
|
||
| export function MeetingOverCTA() { | ||
| const stop = useListener((state) => state.stop); | ||
| const setMicStoppedPending = useListener( | ||
| (state) => state.setMicStoppedPending, | ||
| ); | ||
|
|
||
| return ( | ||
| <div className="flex items-center gap-2 rounded-full border-2 border-stone-600 bg-stone-800 px-4 py-2 text-sm text-white shadow-[0_4px_14px_rgba(87,83,78,0.4)]"> | ||
| <span>Is your meeting over?</span> | ||
| <button | ||
| type="button" | ||
| onClick={() => { | ||
| stop(); | ||
| setMicStoppedPending(false); | ||
| }} | ||
| className="rounded-full bg-white px-3 py-1 text-xs font-medium text-stone-800 transition-colors hover:bg-stone-200" | ||
| > | ||
| Yes | ||
| </button> | ||
| <button | ||
| type="button" | ||
| onClick={() => setMicStoppedPending(false)} | ||
| className="rounded-full border border-stone-500 px-3 py-1 text-xs font-medium text-stone-300 transition-colors hover:bg-stone-700" | ||
| > | ||
| No | ||
| </button> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import { useShallow } from "zustand/shallow"; | |
|
|
||
| import { events as detectEvents } from "@hypr/plugin-detect"; | ||
| import { commands as notificationCommands } from "@hypr/plugin-notification"; | ||
| import { commands as windowsCommands } from "@hypr/plugin-windows"; | ||
|
|
||
| import * as main from "~/store/tinybase/store/main"; | ||
| import { | ||
|
|
@@ -87,6 +88,7 @@ function getNearbyEvents( | |
| const useHandleDetectEvents = (store: ListenerStore) => { | ||
| const stop = useStore(store, (state) => state.stop); | ||
| const setMuted = useStore(store, (state) => state.setMuted); | ||
| const setMicStoppedPending = useStore(store, (state) => state.setMicStoppedPending); | ||
| const tinybaseStore = main.UI.useStore(main.STORE_ID); | ||
|
|
||
| const tinybaseStoreRef = useRef(tinybaseStore); | ||
|
|
@@ -144,7 +146,8 @@ const useHandleDetectEvents = (store: ListenerStore) => { | |
| icon: null, | ||
| }); | ||
| } else if (payload.type === "micStopped") { | ||
| stop(); | ||
| setMicStoppedPending(true); | ||
| windowsCommands.windowShow({ type: "main" }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing active session guard for micStopped event handlerMedium Severity The Reviewed by Cursor Bugbot for commit a7ae905. Configure here. |
||
| } else if (payload.type === "sleepStateChanged") { | ||
| if (payload.value) { | ||
| stop(); | ||
|
|
@@ -168,5 +171,5 @@ const useHandleDetectEvents = (store: ListenerStore) => { | |
| cancelled = true; | ||
| unlisten?.(); | ||
| }; | ||
| }, [stop, setMuted]); | ||
| }, [stop, setMuted, setMicStoppedPending]); | ||
| }; | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale
micStoppedPendingflag can stop a subsequent sessionHigh Severity
micStoppedPendingis only cleared by theMeetingOverCTAbuttons ("Yes"/"No"). If the session stops through any other path — the header "Stop" button, asleepStateChangedevent, or an error — the flag staystrue. When the user later starts a new session, the stale CTA appears, and clicking "Yes" callsstop()on the new session, terminating it unexpectedly. The flag needs to be cleared whenever the live session transitions to inactive (e.g., inmarkLiveInactiveor equivalent).Additional Locations (1)
apps/desktop/src/stt/contexts.tsx#L147-L150Reviewed by Cursor Bugbot for commit a7ae905. Configure here.