mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 16:00:58 +00:00
Fix up context check
This commit is contained in:
parent
8a96741441
commit
63bfe95c18
5 changed files with 19 additions and 29 deletions
|
|
@ -52,7 +52,7 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
|||
(originalConsole as any)[method].apply(console, args);
|
||||
|
||||
// Send immediately and track the promise (only in extension context)
|
||||
if ((window as any).__isExtensionContext?.()) {
|
||||
if ((window as any).sendRuntimeMessage) {
|
||||
const sendPromise = (window as any)
|
||||
.sendRuntimeMessage({
|
||||
type: "console",
|
||||
|
|
@ -108,7 +108,7 @@ export class ConsoleRuntimeProvider implements SandboxRuntimeProvider {
|
|||
|
||||
const finalError = error || lastError;
|
||||
|
||||
if ((window as any).__isExtensionContext?.()) {
|
||||
if ((window as any).sendRuntimeMessage) {
|
||||
if (finalError) {
|
||||
await (window as any).sendRuntimeMessage({
|
||||
type: "execution-error",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue