diff --git a/src/ui/layout/AppLayout.vue b/src/ui/layout/AppLayout.vue index 3f6cac8b0a..6f1df14a08 100644 --- a/src/ui/layout/AppLayout.vue +++ b/src/ui/layout/AppLayout.vue @@ -208,13 +208,15 @@ export default { }, inject: ['openmct'], data: function () { - let storedHeadProps = window.localStorage.getItem('openmct-shell-head'); - let headExpanded = true; - let indicatorsMultiline = true; - if (storedHeadProps) { - headExpanded = JSON.parse(storedHeadProps).expanded; - indicatorsMultiline = JSON.parse(storedHeadProps).multiline; - } + const DEFAULT_HEAD_EXPANDED = true; + const DEFAULT_INDICATORS_MULTILINE = true; + + const storedHeadProps = JSON.parse(localStorage.getItem('openmct-shell-head')); + const storedHeadExpanded = storedHeadProps?.expanded; + const storedIndicatorsMultiline = storedHeadProps?.multiline; + + const headExpanded = storedHeadExpanded ?? DEFAULT_HEAD_EXPANDED; + const indicatorsMultiline = storedIndicatorsMultiline ?? DEFAULT_INDICATORS_MULTILINE; return { fullScreen: false,