From 22b022be8228a76d9344d8bc1db9a1459e093cac Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 14 Feb 2019 10:32:00 +0100 Subject: [PATCH] GitHost SSH Key: Make the message more informative This way, the user will have more feedback about what step in the process are they. --- lib/screens/githostsetup_autoconfigure.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/screens/githostsetup_autoconfigure.dart b/lib/screens/githostsetup_autoconfigure.dart index 5a428f58..4a70b7d2 100644 --- a/lib/screens/githostsetup_autoconfigure.dart +++ b/lib/screens/githostsetup_autoconfigure.dart @@ -25,7 +25,9 @@ class GitHostSetupAutoConfigure extends StatefulWidget { class GitHostSetupAutoConfigureState extends State { GitHost gitHost; String errorMessage = ""; + bool _configuringStarted = false; + String _message = "Waiting for Permissions ..."; @override void initState() { @@ -48,10 +50,21 @@ class GitHostSetupAutoConfigureState extends State { GitRepo repo; try { + this.setState(() { + _message = "Creating private repo"; + }); + // FIXME: What if repo already exists? repo = await gitHost.createRepo("journal"); + this.setState(() { + _message = "Generating SSH Key"; + }); var publicKey = await generateSSHKeys(comment: "GitJournal"); + + this.setState(() { + _message = "Adding as a Deploy Key"; + }); await gitHost.addDeployKey(publicKey, repo.fullName); var userInfo = await gitHost.getUserInfo(); @@ -83,7 +96,7 @@ class GitHostSetupAutoConfigureState extends State { Widget build(BuildContext context) { if (_configuringStarted) { if (this.errorMessage == null || this.errorMessage.isEmpty) { - return GitHostSetupLoadingPage("Configuring ..."); + return GitHostSetupLoadingPage(_message); } return GitHostSetupErrorPage(errorMessage);