fix: render loading spinner if no hash
This commit is contained in:
@@ -4,7 +4,7 @@ import { GetCurrentBlockPage } from "@/lib/graphql/Query/CurrentBlockPage.graphq
|
||||
import type { PageArgs, LangParams, UriParams } from "@/types/params"
|
||||
import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
|
||||
import ContentstackLivePreview from "@contentstack/live-preview-utils"
|
||||
import LoadingPreview from "@/components/Current/LoadingPreview"
|
||||
import LoadingSpinner from "@/components/Current/LoadingSpinner"
|
||||
import ContentPage from "@/components/Current/ContentPage"
|
||||
|
||||
export default async function CurrentContentPage({
|
||||
@@ -14,8 +14,8 @@ export default async function CurrentContentPage({
|
||||
try {
|
||||
ContentstackLivePreview.setConfigFromParams(searchParams)
|
||||
|
||||
if (!searchParams.uri) {
|
||||
return <LoadingPreview />
|
||||
if (!searchParams.uri || !searchParams["live_preview"]) {
|
||||
return <LoadingSpinner />
|
||||
}
|
||||
|
||||
const response = await previewRequest<GetCurrentBlockPageData>(
|
||||
|
||||
Reference in New Issue
Block a user