Skip to content

Commit a34dc35

Browse files
authored
fix android multiple active states
1 parent ac63705 commit a34dc35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function useAppState(settings) {
77

88
useEffect(() => {
99
function handleAppStateChange(nextAppState) {
10-
if (nextAppState === 'active') {
10+
if (nextAppState === 'active' && appState !== 'active') {
1111
isValidFunction(onForeground) && onForeground();
1212
} else if (appState === 'active' && nextAppState.match(/inactive|background/)) {
1313
isValidFunction(onBackground) && onBackground();

0 commit comments

Comments
 (0)