1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

receiving window messages

This commit is contained in:
Fedor Katurov 2019-11-02 18:45:58 +07:00
parent f7b8b56b53
commit 49bccb96c1
8 changed files with 68 additions and 37 deletions

View file

@ -25,6 +25,7 @@ import playerSaga from '~/redux/player/sagas';
import { IAuthState } from '~/redux/auth/types';
import modalReducer, { IModalState } from '~/redux/modal/reducer';
import { gotPostMessage } from './auth/actions';
const authPersistConfig: PersistConfig = {
key: 'auth',
@ -70,6 +71,8 @@ export function configureStore(): { store: Store<IState>; persistor: Persistor }
sagaMiddleware.run(flowSaga);
sagaMiddleware.run(playerSaga);
window.addEventListener('message', message => store.dispatch(gotPostMessage(message)));
const persistor = persistStore(store);
return { store, persistor };