Skip to content

Commit

Permalink
hide preview in desktop (#1987)
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer authored Nov 8, 2024
1 parent 8dd931d commit d100faf
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/browser/modules/Stream/PlayFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -207,7 +207,8 @@ function generateContent(
bus: Bus,
onSlide: any,
shouldUseSlidePointer: boolean,
showPromotion = false
showPromotion = false,
inDesktop = false
): Content | Promise<Content> {
// Not found
if (stackFrame.response && stackFrame.response.status === 404) {
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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))

0 comments on commit d100faf

Please sign in to comment.