Skip to content

Commit

Permalink
Trigger refresh on app enter foreground
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelekol committed May 11, 2022
1 parent b084b1c commit 48866dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package io.horizontalsystems.ethereumkit.core

import android.app.Application
import android.content.Context
import android.os.Handler
import android.os.Looper
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import io.horizontalsystems.ethereumkit.api.core.*
Expand Down Expand Up @@ -130,6 +132,9 @@ class EthereumKit(

fun onEnterForeground() {
connectionManager.onEnterForeground()
Handler(Looper.getMainLooper()).postDelayed({
blockchain.refresh()
}, 1000)
}

fun onEnterBackground() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class ConnectionManager(context: Context) {

private fun setInitialValues() {
isConnected = getInitialConnectionStatus()
listener?.onConnectionChange()
}

private fun getInitialConnectionStatus(): Boolean {
Expand Down

0 comments on commit 48866dc

Please sign in to comment.