Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix: meeting notification window invisible due to Vite ESM timing race

Gabriel Stein7268b045762b
diff --git a/preload.js b/preload.js
index 91952914e..a17e5b70c 100644
--- a/preload.js
+++ b/preload.js
@@ -646,6 +646,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
(callback) => (_event, data) => callback(data)
),
getMeetingNotificationData: () => ipcRenderer.invoke("get-meeting-notification-data"),
+ meetingNotificationReady: () => ipcRenderer.invoke("meeting-notification-ready"),
meetingNotificationRespond: (detectionId, action) =>
ipcRenderer.invoke("meeting-notification-respond", detectionId, action),
onNavigateToMeetingNote: registerListener(
diff --git a/src/components/MeetingNotificationOverlay.tsx b/src/components/MeetingNotificationOverlay.tsx
index 8542dbd25..7388766cc 100644
--- a/src/components/MeetingNotificationOverlay.tsx
+++ b/src/components/MeetingNotificationOverlay.tsx
@@ -15,18 +15,24 @@ export default function MeetingNotificationOverlay() {
const [isVisible, setIsVisible] = useState(false);
useEffect(() => {
- const cleanup = window.electronAPI?.onMeetingNotificationData?.(
- (incoming: NotificationData) => {
- setData(incoming);
- setTimeout(() => setIsVisible(true), 50);
- }
+ let shown = false;
+
+ const show = (d: NotificationData) => {
+ if (shown) return;
+ shown = true;
+ setData(d);
+ setTimeout(() => {
+ setIsVisible(true);
+ window.electronAPI?.meetingNotificationReady?.();
+ }, 50);
+ };
+
+ const cleanup = window.electronAPI?.onMeetingNotificationData?.((incoming: NotificationData) =>
+ show(incoming)
);
window.electronAPI?.getMeetingNotificationData?.().then((pulled: NotificationData | null) => {
- if (pulled) {
- setData((prev) => prev ?? pulled);
- setTimeout(() => setIsVisible(true), 50);
- }
+ if (pulled) show(pulled);
});
return () => cleanup?.();
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 67d99cbb2..e872c5215 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -3889,6 +3889,10 @@ class IPCHandlers {
return this.windowManager?._pendingNotificationData ?? null;
});
+ ipcMain.handle("meeting-notification-ready", async () => {
+ this.windowManager?.showNotificationWindow();
+ });
+
ipcMain.handle("get-desktop-sources", async (_event, types) => {
try {
const { desktopCapturer } = require("electron");
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index f64df9acc..0c01f5cb1 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -956,18 +956,18 @@ class WindowManager {
this._pendingNotificationData = promptData;
- const sendAndShow = () => {
+ this._notificationReadyFallback = setTimeout(() => {
+ this._notificationReadyFallback = null;
if (this.notificationWindow && !this.notificationWindow.isDestroyed()) {
+ debugLogger.warn(
+ "Notification renderer did not signal ready, force-showing",
+ {},
+ "meeting"
+ );
this.notificationWindow.webContents.send("meeting-notification-data", promptData);
this.notificationWindow.showInactive();
}
- };
-
- if (this.notificationWindow.webContents.isLoading()) {
- this.notificationWindow.webContents.once("did-finish-load", sendAndShow);
- } else {
- sendAndShow();
- }
+ }, 3000);
this._notificationTimeout = setTimeout(() => {
if (this.meetingDetectionEngine) {
@@ -985,8 +985,22 @@ class WindowManager {
});
}
+ showNotificationWindow() {
+ if (this._notificationReadyFallback) {
+ clearTimeout(this._notificationReadyFallback);
+ this._notificationReadyFallback = null;
+ }
+ if (this.notificationWindow && !this.notificationWindow.isDestroyed()) {
+ this.notificationWindow.showInactive();
+ }
+ }
+
dismissMeetingNotification() {
this._pendingNotificationData = null;
+ if (this._notificationReadyFallback) {
+ clearTimeout(this._notificationReadyFallback);
+ this._notificationReadyFallback = null;
+ }
if (this._notificationTimeout) {
clearTimeout(this._notificationTimeout);
this._notificationTimeout = null;
diff --git a/src/types/electron.ts b/src/types/electron.ts
index c692f3000..4acdfd909 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -1168,6 +1168,7 @@ declare global {
onMeetingDetectedStartRecording?: (callback: (data: any) => void) => () => void;
onMeetingNotificationData?: (callback: (data: any) => void) => () => void;
getMeetingNotificationData?: () => Promise<any>;
+ meetingNotificationReady?: () => Promise<void>;
meetingNotificationRespond?: (
detectionId: string,
action: string