|
@@ -33,10 +33,10 @@ import { MiddlewareRegistry } from '../base/redux';
|
33
|
33
|
MiddlewareRegistry.register(store => next => action => {
|
34
|
34
|
switch (action.type) {
|
35
|
35
|
case _SET_APP_STATE_LISTENER: {
|
36
|
|
- const bgState = store.getState()['features/background'];
|
|
36
|
+ const { appStateListener } = store.getState()['features/background'];
|
37
|
37
|
|
38
|
|
- if (bgState.appStateListener) {
|
39
|
|
- AppState.removeEventListener('change', bgState.listener);
|
|
38
|
+ if (appStateListener) {
|
|
39
|
+ AppState.removeEventListener('change', appStateListener);
|
40
|
40
|
}
|
41
|
41
|
if (action.listener) {
|
42
|
42
|
AppState.addEventListener('change', action.listener);
|