Skip to content

Commit 8e33293

Browse files
committed
fix
1 parent c9e6787 commit 8e33293

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

apps/desktop/src/main/browser-agent/keyboard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* parsing "Cmd+Shift+Z"-style combos and building the trusted CDP
44
* keyDown/keyUp pair. Pure logic except {@link dispatchKeyCombo}.
55
*/
6+
import { getErrorMessage } from '@sim/utils/errors'
67
import type { WebContents } from 'electron'
78
import * as cdp from '@/main/browser-agent/cdp'
89
import { ToolError } from '@/main/browser-agent/errors'
@@ -303,7 +304,7 @@ export async function dispatchKeyCombo(contents: WebContents, combo: ParsedCombo
303304
await cdp.dispatchKeyEvent(contents, up).catch(() => {})
304305
}
305306
throw new KeyDispatchError(
306-
error instanceof Error ? error.message : 'Trusted key dispatch failed',
307+
getErrorMessage(error, 'Trusted key dispatch failed'),
307308
keyDownDispatched
308309
)
309310
} finally {

packages/emcn/src/components/modal/modal.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* @vitest-environment jsdom
33
*/
44
import { act, type ReactNode, useState } from 'react'
5+
import { sleep } from '@sim/utils/helpers'
56
import { createRoot, type Root } from 'react-dom/client'
67
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
78
import {
@@ -247,7 +248,7 @@ describe('native-surface modal preparation', () => {
247248
if (!close) throw new Error('Modal close button did not render')
248249
await act(async () => {
249250
close.click()
250-
await new Promise((resolve) => setTimeout(resolve, 20))
251+
await sleep(20)
251252
})
252253
expect(document.activeElement).toBe(trigger)
253254
})

0 commit comments

Comments
 (0)