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:
parent
f7b8b56b53
commit
49bccb96c1
8 changed files with 68 additions and 37 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue