Skip to content

Commit 8cc6f6d

Browse files
author
Alex Patterson
committed
stega only on content
1 parent 1268f2f commit 8cc6f6d

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎sanity/lib/client.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export const client = createClient({
1212
studioUrl,
1313
// logger: console,
1414
filter: (props) => {
15-
if (props.sourcePath.at(-1) === "title") {
16-
return true;
15+
if (props.sourcePath.at(0) !== "content") {
16+
return false;
17+
} else {
18+
return props.filterDefault(props);
1719
}
18-
19-
return props.filterDefault(props);
2020
},
2121
},
2222
});

‎sanity/lib/fetch.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ export async function sanityFetch<QueryResponse>({
1919
* The Sanity Presentation Tool will enable Draft Mode when loading up the live preview, and we use it as a signal for when to embed source maps.
2020
* When outside of the Sanity Studio we also support the Vercel Toolbar Visual Editing feature, which is only enabled in production when it's a Vercel Preview Deployment.
2121
*/
22-
// stega = perspective === "previewDrafts" ||
23-
// process.env.VERCEL_ENV === "preview",
24-
stega = false,
22+
stega = perspective === "previewDrafts" ||
23+
process.env.VERCEL_ENV === "preview",
2524
}: {
2625
query: string;
2726
params?: QueryParams;
@@ -30,7 +29,7 @@ export async function sanityFetch<QueryResponse>({
3029
}) {
3130
if (perspective === "previewDrafts") {
3231
return client.fetch<QueryResponse>(query, params, {
33-
stega: false,
32+
stega,
3433
perspective: "previewDrafts",
3534
// The token is required to fetch draft content
3635
token,
@@ -41,7 +40,7 @@ export async function sanityFetch<QueryResponse>({
4140
});
4241
}
4342
return client.fetch<QueryResponse>(query, params, {
44-
stega: false,
43+
stega,
4544
perspective: "published",
4645
// The `published` perspective is available on the API CDN
4746
useCdn: true,

0 commit comments

Comments
 (0)