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

Safe check appdelegate wallet operations #798

Merged
merged 10 commits into from Jun 6, 2021

Conversation

macsleven
Copy link
Contributor

@macsleven macsleven commented Jun 1, 2021

  • This PR safe checks wallet operations when app is not fully active.
  • optimized wallet sync operations and not allowing the os screen sleep while wallet is syncing,mixing or rescanning.

@macsleven macsleven added this to In progress in dcrios board Jun 1, 2021
@macsleven macsleven marked this pull request as ready for review June 2, 2021 06:33
@@ -716,19 +717,22 @@ extension OverviewViewController: DcrlibwalletSyncProgressListenerProtocol {
func onSyncCanceled(_ willRestart: Bool) {
DispatchQueue.main.async {
self.updateUI(syncCompletedSuccessfully: false)
UIApplication.shared.isIdleTimerDisabled = false
Copy link
Contributor

Choose a reason for hiding this comment

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

We have many different synchronous processes, so we have to check them all to complete to set UIApplication.shared.isIdleTimerDisabled = false

}
}

func onSyncCompleted() {
DispatchQueue.main.async {
self.updateUI(syncCompletedSuccessfully: true)
self.setMixerStatus()
UIApplication.shared.isIdleTimerDisabled = false
Copy link
Contributor

Choose a reason for hiding this comment

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

same above

}
}

func onSyncEndedWithError(_ err: Error?) {
DispatchQueue.main.async {
self.updateUI(syncCompletedSuccessfully: false)
UIApplication.shared.isIdleTimerDisabled = false
Copy link
Contributor

Choose a reason for hiding this comment

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

same above

@@ -821,6 +826,7 @@ extension OverviewViewController: DcrlibwalletBlocksRescanProgressListenerProtoc

func onBlocksRescanEnded(_ walletID: Int, err: Error?) {
DispatchQueue.main.async {
UIApplication.shared.isIdleTimerDisabled = false
Copy link
Contributor

Choose a reason for hiding this comment

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

same above

@macsleven macsleven merged commit b26cf16 into planetdecred:master Jun 6, 2021
dcrios board automation moved this from In progress to Done Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
dcrios board
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants