|
|
|
|
@ -1,4 +1,6 @@ |
|
|
|
|
window.fireGlobalEvent = function _fireGlobalEvent(eventName, params) { |
|
|
|
|
window.dispatchEvent(new CustomEvent(eventName, {detail: params})); |
|
|
|
|
|
|
|
|
|
Tracker.autorun((computation) => { |
|
|
|
|
const enabled = RocketChat.settings.get('Iframe_Integration_send_enable'); |
|
|
|
|
if (enabled === undefined) { |
|
|
|
|
@ -6,7 +8,6 @@ window.fireGlobalEvent = function _fireGlobalEvent(eventName, params) { |
|
|
|
|
} |
|
|
|
|
computation.stop(); |
|
|
|
|
if (enabled) { |
|
|
|
|
window.dispatchEvent(new CustomEvent(eventName, {detail: params})); |
|
|
|
|
parent.postMessage({ |
|
|
|
|
eventName, |
|
|
|
|
data: params |
|
|
|
|
@ -14,3 +15,4 @@ window.fireGlobalEvent = function _fireGlobalEvent(eventName, params) { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|