From 96bef51c86860e07e753708c994e01a7a7cfe0d0 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Tue, 23 Mar 2021 14:55:31 -0600 Subject: [PATCH] UI/namespace bug (#11182) * fix with console to confirm showing * remove console * move order * add changelog --- changelog/11182.txt | 4 ++++ ui/app/components/namespace-link.js | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelog/11182.txt diff --git a/changelog/11182.txt b/changelog/11182.txt new file mode 100644 index 000000000000..cdb40ed8497d --- /dev/null +++ b/changelog/11182.txt @@ -0,0 +1,4 @@ +```release-note:bug +ui: Fix namespace-bug on login +``` + diff --git a/ui/app/components/namespace-link.js b/ui/app/components/namespace-link.js index 310fb219f72c..954a5f0b6c71 100644 --- a/ui/app/components/namespace-link.js +++ b/ui/app/components/namespace-link.js @@ -19,11 +19,9 @@ export default Component.extend({ namespaceDisplay: computed('normalizedNamespace', 'showLastSegment', function() { let ns = this.normalizedNamespace; + if (!ns) return 'root'; let showLastSegment = this.showLastSegment; - let parts = ns.split('/'); - if (ns === '') { - return 'root'; - } + let parts = ns?.split('/'); return showLastSegment ? parts[parts.length - 1] : ns; }),