Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk(react-native-sdk): error fixes #13549

Merged
merged 11 commits into from
Jul 12, 2023

Conversation

Calinteodor
Copy link
Contributor

No description provided.

@@ -74,8 +74,11 @@ function _setAppStateListenerF({ getState }: IStore, next: Function, action: Any
const result = next(action);
const { appStateListener: newListener } = getState()['features/background'];

// @ts-ignore
const appStateOldListener = AppState.addEventListener('change', oldListener);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't remove the previous listener. We need to store the return value of AppState.addEventListener and place that in redux.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created an action(eventSubcription) that stores the previous appStateListener.

@saghul
Copy link
Member

saghul commented Jul 11, 2023

You can simplify things by storing only the subscription and not the listener.

@saghul
Copy link
Member

saghul commented Jul 12, 2023

Can you pl rename things along the lines of _SET_APP_STATE_SUBSCRIPTION then?

_ means it's a private action
Action names being with a verb, so SET.
And last, the name is more descriptive.

@Calinteodor Calinteodor merged commit 27c62b3 into jitsi:master Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants