Skip to content
Snippets Groups Projects
Commit 6fca8e5c authored by Markin Igor's avatar Markin Igor
Browse files

Add reveal timer cancellation.

parent 675f7da0
No related branches found
No related tags found
1 merge request!2Resolve "Rework auth flow."
...@@ -141,10 +141,11 @@ class _MainAppState extends State<MainApp> { ...@@ -141,10 +141,11 @@ class _MainAppState extends State<MainApp> {
}); });
initUniLinks();
// Show buttons after timeout // Show buttons after timeout
revealButtons(3); revealButtons(3);
initUniLinks();
} }
@override @override
...@@ -163,8 +164,20 @@ class _MainAppState extends State<MainApp> { ...@@ -163,8 +164,20 @@ class _MainAppState extends State<MainApp> {
}); });
} }
hideButtons() {
if (_revealTimer != null && _revealTimer.isActive) {
_revealTimer.cancel();
}
setState(() {
_buttonsHidden = true;
});
}
Timer _revealTimer;
revealButtons(delay) { revealButtons(delay) {
Timer( _revealTimer = Timer(
Duration(seconds: delay), Duration(seconds: delay),
() { () {
setState(() { setState(() {
...@@ -209,9 +222,7 @@ class _MainAppState extends State<MainApp> { ...@@ -209,9 +222,7 @@ class _MainAppState extends State<MainApp> {
} }
// Hide buttons so they wont blink after we close or finish oauth // Hide buttons so they wont blink after we close or finish oauth
setState(() { hideButtons();
_buttonsHidden = true;
});
setScreen(Screen.OAuth); setScreen(Screen.OAuth);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment