Skip to content

Commit

Permalink
fix: BroadcastChannel 兼容性问题 (#11474)
Browse files Browse the repository at this point in the history
  • Loading branch information
allenve authored Jan 9, 2025
1 parent 24e8538 commit d9bad55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/amis-core/src/utils/renderer-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const bindGlobalEventForRenderer = (renderer: any) => {
if (listeners) {
for (let key of Object.keys(listeners)) {
const listener = listeners[key];
if (!BroadcastChannel) {
if (typeof BroadcastChannel !== 'function') {
console.error('BroadcastChannel is not supported in your browser');
return;
}
Expand Down Expand Up @@ -247,7 +247,7 @@ export const bindGlobalEvent = (
eventName: string,
callback: (data: PlainObject) => void
) => {
if (!BroadcastChannel) {
if (typeof BroadcastChannel !== 'function') {
console.error('BroadcastChannel is not supported in your browser');
return;
}
Expand Down Expand Up @@ -419,7 +419,7 @@ export async function dispatchGlobalEventForRenderer(
}

export async function dispatchGlobalEvent(eventName: string, data: any) {
if (!BroadcastChannel) {
if (typeof BroadcastChannel !== 'function') {
console.error('BroadcastChannel is not supported in your browser');
return;
}
Expand Down

0 comments on commit d9bad55

Please sign in to comment.