Show extra labels only when there's something inside

This commit is contained in:
DarkPhoenix
2019-10-02 10:56:01 +03:00
parent c040353f6e
commit 05ac0a528a
7 changed files with 21 additions and 13 deletions

View File

@@ -264,9 +264,10 @@ class CommandView(d.Display):
info = commandFit.getCommandInfo(fitID)
if info is not None and info.active:
amount += 1
return ' ({})'.format(amount)
return ' ({})'.format(amount) if amount else None
# Total amount of command fits
elif opt == 2:
return ' ({})'.format(len(fit.commandFits))
amount = len(fit.commandFits)
return ' ({})'.format(amount) if amount else None
else:
return None