1
0
mirror of synced 2024-09-24 11:28:25 +02:00

If a user is a member of only one arcade, display it directly instead of a drop-down in the nav menu.

This commit is contained in:
Jennifer Taylor 2021-08-28 19:35:44 +00:00
parent 19aa273bf8
commit 71def6254d

View File

@ -693,7 +693,14 @@ def navigation() -> Dict[str, Any]:
# Arcade owner pages
arcadeids = g.data.local.machine.from_userid(g.userID)
if len(arcadeids) > 0:
if len(arcadeids) == 1:
arcade = g.data.local.machine.get_arcade(arcadeids[0])
pages.append({
'label': arcade.name,
'uri': url_for('arcade_pages.viewarcade', arcadeid=arcade.id),
'right_justify': True,
})
elif len(arcadeids) > 1:
entries = []
for arcadeid in arcadeids:
arcade = g.data.local.machine.get_arcade(arcadeid)