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

fix: handle etherscan rate limit errors #7209

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ const Main = (props) => {
const handleAppStateChange = useCallback(
(appState) => {
const newModeIsBackground = appState === 'background';
const { TransactionController } = Engine.context;

// If it was in background and it's not anymore
// we need to stop the Background timer
if (backgroundMode.current && !newModeIsBackground) {
Expand All @@ -167,6 +169,10 @@ const Main = (props) => {
// the background timer, which is less intense
if (backgroundMode.current) {
removeNotVisibleNotifications();

BackgroundTimer.runBackgroundTimer(async () => {
await TransactionController.updateIncomingTransactions();
}, AppConstants.TX_CHECK_BACKGROUND_FREQUENCY);
sethkfman marked this conversation as resolved.
Show resolved Hide resolved
}
},
[backgroundMode, removeNotVisibleNotifications],
Expand Down
1 change: 1 addition & 0 deletions app/core/AppConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
IS_DEV: process.env?.NODE_ENV === DEVELOPMENT,
DEFAULT_LOCK_TIMEOUT: 30000,
DEFAULT_SEARCH_ENGINE: 'DuckDuckGo',
TX_CHECK_BACKGROUND_FREQUENCY: 30000,
IPFS_OVERRIDE_PARAM: 'mm_override',
IPFS_DEFAULT_GATEWAY_URL: 'https://cloudflare-ipfs.com/ipfs/',
IPNS_DEFAULT_GATEWAY_URL: 'https://cloudflare-ipfs.com/ipns/',
Expand Down
Loading
Loading