Skip to content

Commit bea5c05

Browse files
committed
Only allow item selection if orgs are non-empty
The org count being empty means they did not successfully load so don't allow further navigation in this case.
1 parent 8d1a5b8 commit bea5c05

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/src/main/java/com/github/mobile/ui/user/HomeActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public boolean onNavigationItemSelected(int itemPosition, long itemId) {
216216
if (homeAdapter.isOrgPosition(itemPosition)) {
217217
homeAdapter.setSelected(itemPosition);
218218
setOrg(orgs.get(itemPosition));
219-
} else {
219+
} else if (homeAdapter.getOrgCount() > 0) {
220220
switch (homeAdapter.getAction(itemPosition)) {
221221
case ACTION_GISTS:
222222
startActivity(new Intent(this, GistsActivity.class));

app/src/main/java/com/github/mobile/ui/user/HomeDropdownListAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public HomeDropdownListAdapter(final Context context,
8383
*
8484
* @return org count
8585
*/
86-
private int getOrgCount() {
86+
public int getOrgCount() {
8787
return getCount() - NON_ORG_ITEMS;
8888
}
8989

0 commit comments

Comments
 (0)