mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
Remove code duplication
This commit is contained in:
@ -89,35 +89,30 @@ class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
|
|||||||
}
|
}
|
||||||
Settings.instance.save();
|
Settings.instance.save();
|
||||||
} on GitHostException catch (e) {
|
} on GitHostException catch (e) {
|
||||||
Fimber.d("GitHostSetupAutoConfigure: " + e.toString());
|
_handleGitHostException(e);
|
||||||
setState(() {
|
|
||||||
errorMessage = widget.gitHostType.toString() + ": " + e.toString();
|
|
||||||
getAnalytics().logEvent(
|
|
||||||
name: "githostsetup_error",
|
|
||||||
parameters: <String, dynamic>{
|
|
||||||
'errorMessage': errorMessage,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
widget.onDone(repo.cloneUrl);
|
widget.onDone(repo.cloneUrl);
|
||||||
});
|
});
|
||||||
gitHost.launchOAuthScreen();
|
gitHost.launchOAuthScreen();
|
||||||
} on GitHostException catch (e) {
|
} on GitHostException catch (e) {
|
||||||
Fimber.d("GitHostSetupAutoConfigure: " + e.toString());
|
_handleGitHostException(e);
|
||||||
setState(() {
|
|
||||||
errorMessage = widget.gitHostType.toString() + ": " + e.toString();
|
|
||||||
getAnalytics().logEvent(
|
|
||||||
name: "githostsetup_error",
|
|
||||||
parameters: <String, dynamic>{
|
|
||||||
'errorMessage': errorMessage,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _handleGitHostException(GitHostException e) {
|
||||||
|
Fimber.d("GitHostSetupAutoConfigure: " + e.toString());
|
||||||
|
setState(() {
|
||||||
|
errorMessage = widget.gitHostType.toString() + ": " + e.toString();
|
||||||
|
getAnalytics().logEvent(
|
||||||
|
name: "githostsetup_error",
|
||||||
|
parameters: <String, dynamic>{
|
||||||
|
'errorMessage': errorMessage,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_configuringStarted) {
|
if (_configuringStarted) {
|
||||||
|
Reference in New Issue
Block a user