feat: Allow Dashboard App Frames to query the information (#5313)

Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
This commit is contained in:
Pranav Raj S 2022-08-22 09:27:35 +05:30 committed by GitHub
parent f33ff351cf
commit bef3f66501
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,6 +38,18 @@ export default {
return this.currentChat?.meta?.sender?.id;
},
},
mounted() {
window.onmessage = e => {
if (
typeof e.data !== 'string' ||
e.data !== 'chatwoot-dashboard-app:fetch-info'
) {
return;
}
this.onIframeLoad(0);
};
},
methods: {
onIframeLoad(index) {
const frameElement = document.getElementById(