The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/lib/utils/fireGlobalEvent.ts

19 lines
583 B

import { Tracker } from 'meteor/tracker';
import { fireGlobalEventBase } from './fireGlobalEventBase';
import { settings } from '../../../app/settings/client';
export const fireGlobalEvent = (eventName: string, detail?: unknown): void => {
const dispatchIframeMessage = fireGlobalEventBase(eventName, detail);
Tracker.autorun((computation) => {
const enabled = settings.get('Iframe_Integration_send_enable');
if (enabled === undefined) {
return;
}
computation.stop();
dispatchIframeMessage(enabled, settings.get('Iframe_Integration_send_target_origin'));
});
};