diff --git a/src/browser/index.tsx b/src/browser/index.tsx index c4d3c7ac8c4..13e7a7eb155 100644 --- a/src/browser/index.tsx +++ b/src/browser/index.tsx @@ -22,27 +22,7 @@ import ReactDOM from 'react-dom' import AppInit, { setupSentry } from './AppInit' import './init' -import { navigateToPreview } from './modules/Stream/StartPreviewFrame' -import { optedInByLocalhost } from 'browser-services/preview-optin-service' setupSentry() -;(async () => { - const optedInToPreview = optedInByLocalhost() - try { - const response = await fetch('./preview/manifest.json') - if (response.status === 200) { - if (optedInToPreview) { - navigateToPreview() - } else { - localStorage.setItem('previewAvailable', 'true') - } - } else { - localStorage.setItem('previewAvailable', 'false') - } - } catch (e) { - localStorage.setItem('previewAvailable', 'false') - } - - ReactDOM.render(, document.getElementById('mount')) -})() +ReactDOM.render(, document.getElementById('mount')) diff --git a/src/browser/modules/Stream/PlayFrame.tsx b/src/browser/modules/Stream/PlayFrame.tsx index 3361abb4ab4..133edc35ba7 100644 --- a/src/browser/modules/Stream/PlayFrame.tsx +++ b/src/browser/modules/Stream/PlayFrame.tsx @@ -292,19 +292,16 @@ function generateContent( // Check if content exists locally if (isPlayChapter(guideName)) { - const isPreviewAvailable = - localStorage.getItem('previewAvailable') === 'true' && !inDesktop - const { content, title, subtitle, slides = null } = chapters[guideName] const isPlayStart = stackFrame.cmd.trim() === ':play start' const updatedContent = isPlayStart && showPromotion ? ( <> - {isPreviewAvailable ? : content} + {!inDesktop ? : content} - ) : isPreviewAvailable ? ( + ) : !inDesktop ? ( ) : ( content diff --git a/src/browser/modules/Stream/StartPreviewFrame.tsx b/src/browser/modules/Stream/StartPreviewFrame.tsx index fc40f654bc6..a4d70b43ff7 100644 --- a/src/browser/modules/Stream/StartPreviewFrame.tsx +++ b/src/browser/modules/Stream/StartPreviewFrame.tsx @@ -18,39 +18,28 @@ * along with this program. If not, see . */ import React, { Dispatch } from 'react' -import { Action } from 'redux' -import { trackNavigateToPreview } from 'shared/modules/preview/previewDuck' import { connect } from 'react-redux' import { withBus } from 'react-suber' +import { Action } from 'redux' import { GlobalState } from 'shared/globalState' import { Connection, getActiveConnectionData } from 'shared/modules/connections/connectionsDuck' +import { trackNavigateToPreview } from 'shared/modules/preview/previewDuck' -export const navigateToPreview = ( - db?: string | null, - dbms?: string | null -): void => { - const url = new URL(window.location.href) +const navigateToPreview = (db?: string | null, dbms?: string | null): void => { + const url = new URL('https://browser.neo4j.io/') - if ( - dbms && - !url.searchParams.has('dbms') && - !url.searchParams.get('connectURL') - ) { + if (dbms) { url.searchParams.set('dbms', dbms) } - if (db && !url.searchParams.has('db')) { + if (db) { url.searchParams.set('db', db) } - const previewPath = '/preview/' - if (!url.pathname.endsWith(previewPath)) { - url.pathname = url.pathname.replace(/\/?$/, previewPath) - window.location.href = decodeURIComponent(url.toString()) - } + window.open(url.toString(), '_blank', 'noreferrer') } type PreviewFrameProps = { @@ -71,9 +60,9 @@ const PreviewFrame = ({
-

🚀 Try the new Browser preview!

+

🚀 Try the new hosted Browser!

- Switch to the preview experience to access all the latest features. + Switch to the hosted Browser to access all of the latest features.