From 5cdce7ea22680afb8ef77d07a9b7c90d91e3ff9b Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Tue, 13 Jun 2023 09:47:18 +0200 Subject: [PATCH] fix(ui): keep UI form preloaded --- .../Session/Player/LivePlayer/LivePlayerSubHeader.tsx | 9 +++------ frontend/app/components/Session_/Subheader.js | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend/app/components/Session/Player/LivePlayer/LivePlayerSubHeader.tsx b/frontend/app/components/Session/Player/LivePlayer/LivePlayerSubHeader.tsx index 6080fd641..fed51c4b7 100644 --- a/frontend/app/components/Session/Player/LivePlayer/LivePlayerSubHeader.tsx +++ b/frontend/app/components/Session/Player/LivePlayer/LivePlayerSubHeader.tsx @@ -6,14 +6,11 @@ import Tab from 'Components/Session/Player/SharedComponents/Tab'; function SubHeader() { const { store } = React.useContext(PlayerContext); - const { currentTab, tabs, location: currentLocation = '' } = store.get(); + const { currentTab, tabs = new Set('back-compat'), location: currentLocation = 'loading...' } = store.get(); - const location = - currentLocation !== undefined - ? currentLocation.length > 70 + const location = currentLocation.length > 70 ? `${currentLocation.slice(0, 70)}...` - : currentLocation - : undefined; + : currentLocation; return ( <> diff --git a/frontend/app/components/Session_/Subheader.js b/frontend/app/components/Session_/Subheader.js index 561e95a0c..7fa22a2f7 100644 --- a/frontend/app/components/Session_/Subheader.js +++ b/frontend/app/components/Session_/Subheader.js @@ -21,7 +21,7 @@ function SubHeader(props) { const defaultLocalhostWarn = localStorage.getItem(localhostWarnKey) !== '1'; const [showWarningModal, setWarning] = React.useState(defaultLocalhostWarn); const { player, store } = React.useContext(PlayerContext); - const { width, height, endTime, location: currentLocation = '', tabs, currentTab } = store.get(); + const { width, height, endTime, location: currentLocation = 'loading...', tabs = new Set('back-compat'), currentTab } = store.get(); const enabledIntegration = useMemo(() => { const { integrations } = props;