From 2b87ca3ee20aed41b38bf7e8e704d30928cb1faa Mon Sep 17 00:00:00 2001 From: nixzhu Date: Mon, 14 Dec 2015 17:30:47 +0800 Subject: [PATCH] do not show forked repo --- Yep/Services/SocialWorkService.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Yep/Services/SocialWorkService.swift b/Yep/Services/SocialWorkService.swift index 699a4e58..cabaffd2 100644 --- a/Yep/Services/SocialWorkService.swift +++ b/Yep/Services/SocialWorkService.swift @@ -136,7 +136,8 @@ func githubReposWithToken(token: String, failureHandler: ((Reason, String?) -> V URLString = repoInfo["html_url"] as? String, description = repoInfo["description"] as? String, createdAtString = repoInfo["created_at"] as? String, - isPrivate = repoInfo["private"] as? Bool + isPrivate = repoInfo["private"] as? Bool, + isFork = repoInfo["fork"] as? Bool else { continue } @@ -145,6 +146,10 @@ func githubReposWithToken(token: String, failureHandler: ((Reason, String?) -> V continue } + guard !isFork else { + continue + } + let createdAt = NSDate.dateWithISO08601String(createdAtString) let repo = GithubRepo(ID: ID, name: name, fullName: fullName, URLString: URLString, description: description, createdAt: createdAt)