diff options
author | Aien Saidi <aien.saidi@gmail.com> | 2021-03-18 18:17:18 +0100 |
---|---|---|
committer | Sascha <GlancingMind@outlook.com> | 2021-04-07 13:08:26 +0200 |
commit | 7a7e93c91351781db0361591bcedb5f81b05eb6c (patch) | |
tree | ac662cee7140ca2a4c6d7619c4c3197e2e8d3d43 /webui/src | |
parent | 31871f29f13677131d7cb66da189d74fb1d48696 (diff) | |
download | git-bug-7a7e93c91351781db0361591bcedb5f81b05eb6c.tar.gz |
feat: check if there are labels
Diffstat (limited to 'webui/src')
-rw-r--r-- | webui/src/pages/list/FilterToolbar.tsx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/webui/src/pages/list/FilterToolbar.tsx b/webui/src/pages/list/FilterToolbar.tsx index 37f63b98..3046d9d8 100644 --- a/webui/src/pages/list/FilterToolbar.tsx +++ b/webui/src/pages/list/FilterToolbar.tsx @@ -65,7 +65,7 @@ function FilterToolbar({ query, queryLocation }: Props) { const classes = useStyles(); const params: Query = parse(query); const { data: identitiesData } = useListIdentitiesQuery(); - const { data: labelsData } = useListLabelsQuery() + const { data: labelsData } = useListLabelsQuery(); let identities: any = []; let labels: any = []; @@ -153,13 +153,15 @@ function FilterToolbar({ query, queryLocation }: Props) { > Author </FilterDropdown> - <FilterDropdown - dropdown={labels} - itemActive={(key) => hasValue('label', key)} - to={(key) => pipe(replaceParam('label', key), loc)(params)} - > - Label - </FilterDropdown> + {labels.length ? ( + <FilterDropdown + dropdown={labels} + itemActive={(key) => hasValue('label', key)} + to={(key) => pipe(replaceParam('label', key), loc)(params)} + > + Label + </FilterDropdown> + ) : null} <FilterDropdown dropdown={[ ['id', 'ID'], |