Skip to content

Commit

Permalink
fix redundant API call
Browse files Browse the repository at this point in the history
  • Loading branch information
bielikb committed Apr 8, 2020
1 parent a0f3937 commit e8ea3bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Covid/MainScreen/MainViewController.swift
Expand Up @@ -185,13 +185,14 @@ extension MainViewController {
}
}

action()
if Defaults.pushToken == nil {
observer = Defaults.observe(\.pushToken) { _ in
DispatchQueue.main.async {
action()
}
}
} else {
action()
}
}
}
Expand Down

0 comments on commit e8ea3bd

Please sign in to comment.