Merge pull request #1563 from omnivore-app/fix/opengraph-landing

Fix the opengraph image to always return on the landing page
This commit is contained in:
Jackson Harper 2022-12-21 10:27:50 +08:00 committed by GitHub
commit 0cf9ba3e92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -5,8 +5,6 @@ import {
} from '../components/templates/landing/LandingSectionsContainer'
import { LandingHeader } from '../components/templates/landing/LandingHeader'
import { LandingFooter } from '../components/templates/landing/LandingFooter'
import { useGetViewerQuery } from '../lib/networking/queries/useGetViewerQuery'
import { useRouter } from 'next/router'
import { PageMetaData } from '../components/patterns/PageMetaData'
const mobileContainerStyles = {

View file

@ -43,13 +43,22 @@ const subHeadingStyles = {
export default function LandingPage(): JSX.Element {
const router = useRouter()
const { viewerData, viewerDataError, isLoading } = useGetViewerQuery()
const { viewerData, isLoading } = useGetViewerQuery()
if (!isLoading && router.isReady && viewerData?.me) {
router.push('/home')
return <></>
} else if (isLoading) {
return <LoadingView bgColor="#FEFCF5" />
return (
<>
<PageMetaData
title="Omnivore"
path="/"
ogImage="/static/images/og-homepage.png"
/>
<LoadingView bgColor="#FEFCF5" />
</>
)
}
return (