MyCrypto/common/sagas/config.js

14 lines
547 B
JavaScript
Raw Normal View History

import { takeEvery } from 'redux-saga/effects';
2017-09-04 09:30:31 -07:00
import type { Yield, Return, Next } from 'sagas/types';
// @HACK For now we reload the app when doing a language swap to force non-connected
// data to reload. Also the use of timeout to avoid using additional actions for now.
2017-09-04 09:30:31 -07:00
function* handleLanguageChange(): Generator<Yield, Return, Next> {
yield setTimeout(() => location.reload(), 250);
}
2017-09-04 09:30:31 -07:00
export default function* handleConfigChanges(): Generator<Yield, Return, Next> {
yield takeEvery('CONFIG_LANGUAGE_CHANGE', handleLanguageChange);
}