Skip to content

Commit

Permalink
amend background updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Danswar committed Oct 30, 2024
1 parent 7e673c2 commit d701f59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions screen/wallets/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ const Asset = ({ navigation }) => {

useEffect(() => {
const subscription = AppState.addEventListener('change', nextAppState => {
if (appState.current === 'active' && nextAppState.match(/inactive|background/)) {
if (appState.current === 'active' && nextAppState.match(/background/)) {
clearTxRefreshInterval();
clearElapsedTimeInterval();
}

if (appState.current.match(/inactive|background/) && nextAppState === 'active') {
if (appState.current.match(/background/) && nextAppState === 'active') {
setTxRefreshInterval();
setElapsedTimeInterval();
}
Expand Down
4 changes: 2 additions & 2 deletions screen/wallets/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ const WalletHome = ({ navigation }) => {

useEffect(() => {
const subscription = AppState.addEventListener('change', nextAppState => {
if (appState.current === 'active' && nextAppState.match(/inactive|background/)) clearBalanceRefreshInterval();
if (appState.current.match(/inactive|background/) && nextAppState === 'active') setBalanceRefreshInterval();
if (appState.current === 'active' && nextAppState.match(/background/)) clearBalanceRefreshInterval();
if (appState.current.match(/background/) && nextAppState === 'active') setBalanceRefreshInterval();
appState.current = nextAppState;
});

Expand Down

0 comments on commit d701f59

Please sign in to comment.