use of org.jetbrains.plugins.github.api.data.GithubUserDetailed in project intellij-community by JetBrains.
the class GithubShareAction method loadGithubInfoWithModal.
@Nullable
private static GithubInfo loadGithubInfoWithModal(@NotNull final GithubAuthDataHolder authHolder, @NotNull final Project project) {
try {
return GithubUtil.computeValueInModalIO(project, "Access to GitHub", indicator -> {
return GithubUtil.runTask(project, authHolder, indicator, connection -> {
GithubUserDetailed userInfo = GithubApiUtil.getCurrentUser(connection);
HashSet<String> names = new HashSet<>();
for (GithubRepo info : GithubApiUtil.getUserRepos(connection)) {
names.add(info.getName());
}
return new GithubInfo(userInfo, names);
});
});
} catch (IOException e) {
GithubNotifications.showErrorDialog(project, "Failed to Connect to GitHub", e);
return null;
}
}
Aggregations