mirror of
https://github.com/generativefm/generative.fm.git
synced 2026-01-10 07:07:59 -05:00
Add export messaging system
This commit is contained in:
@@ -36,6 +36,16 @@ if (isProduction) {
|
||||
console.log('https://github.com/generative-music/generative.fm');
|
||||
}
|
||||
|
||||
window.addEventListener('message', event => {
|
||||
const { data, source, origin } = event;
|
||||
if (origin !== 'https://play.generative.fm' || source !== window.opener) {
|
||||
return;
|
||||
}
|
||||
if (data.type === 'export-request') {
|
||||
source.postMessage({ type: 'export', state: store.getState() });
|
||||
}
|
||||
});
|
||||
|
||||
render(
|
||||
<Provider store={store}>
|
||||
<App />
|
||||
|
||||
Reference in New Issue
Block a user