fix: disable branch selection if less than 2

This commit is contained in:
Rongjian Zhang 2019-09-25 20:55:06 +08:00
parent cefd0bcb5c
commit 04f483aafe
1 changed files with 4 additions and 1 deletions

View File

@ -293,11 +293,14 @@ class RepositoryScreen extends StatelessWidget {
'' +
numberFormat.format(payload['refs']['totalCount'])),
onTap: () async {
var refs = payload['refs']['nodes'] as List;
if (refs.length < 2) return;
// FIXME: Show all branches
var result = await Provider.of<ThemeModel>(context)
.showDialogOptions(
context,
(payload['refs']['nodes'] as List)
refs
.map((b) => DialogOption(
value: b['name'] as String,
widget: Text(b['name'] as String)))