From 7151d2c52d2ea9a5717a19a5a42fb7ecaf33dc43 Mon Sep 17 00:00:00 2001 From: Oskar Damkjaer Date: Thu, 7 Nov 2024 14:58:47 +0100 Subject: [PATCH] hide preview in desktop --- src/browser/modules/Stream/PlayFrame.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/browser/modules/Stream/PlayFrame.tsx b/src/browser/modules/Stream/PlayFrame.tsx index 247210fa0f..ae2b334d26 100644 --- a/src/browser/modules/Stream/PlayFrame.tsx +++ b/src/browser/modules/Stream/PlayFrame.tsx @@ -28,13 +28,6 @@ import { StackPreviousIcon } from 'browser-components/icons/LegacyIcons' -import docs, { DocItem, isPlayChapter } from '../../documentation' -import Docs from '../Docs/Docs' -import { splitMdSlides } from '../Docs/MD/splitMd' -import FrameAside from '../Frame/FrameAside' -import FrameBodyTemplate from '../Frame/FrameBodyTemplate' -import { ErrorsView } from './CypherFrame/ErrorsView/ErrorsView' -import { AuraPromoLink, PromotionContainer } from './styled' import { CarouselButton } from 'browser-components/buttons' import { splitStringOnFirst, @@ -47,7 +40,14 @@ import { isConnectedAuraHost } from 'shared/modules/connections/connectionsDuck' import { getEdition, isEnterprise } from 'shared/modules/dbMeta/dbMetaDuck' import { DARK_THEME } from 'shared/modules/settings/settingsDuck' import { LAST_GUIDE_SLIDE } from 'shared/modules/udc/udcDuck' +import docs, { DocItem, isPlayChapter } from '../../documentation' +import Docs from '../Docs/Docs' +import { splitMdSlides } from '../Docs/MD/splitMd' +import FrameAside from '../Frame/FrameAside' +import FrameBodyTemplate from '../Frame/FrameBodyTemplate' +import { ErrorsView } from './CypherFrame/ErrorsView/ErrorsView' import PreviewFrame from './StartPreviewFrame' +import { AuraPromoLink, PromotionContainer } from './styled' const AuraPromotion = () => { const theme = useContext(ThemeContext) @@ -207,7 +207,8 @@ function generateContent( bus: Bus, onSlide: any, shouldUseSlidePointer: boolean, - showPromotion = false + showPromotion = false, + inDesktop = false ): Content | Promise { // Not found if (stackFrame.response && stackFrame.response.status === 404) { @@ -289,7 +290,8 @@ function generateContent( // Check if content exists locally if (isPlayChapter(guideName)) { const isPreviewAvailable = - localStorage.getItem('previewAvailable') === 'true' + localStorage.getItem('previewAvailable') === 'true' && !inDesktop + const { content, title, subtitle, slides = null } = chapters[guideName] const isPlayStart = stackFrame.cmd.trim() === ':play start' @@ -383,7 +385,8 @@ const mapStateToProps = (state: GlobalState) => ({ (getEdition(state) !== null && !isEnterprise(state) && !isConnectedAuraHost(state)) || - inDesktop(state) + inDesktop(state), + inDesktop: inDesktop(state) }) export default connect(mapStateToProps)(withBus(PlayFrame))