Skip to content

Commit

Permalink
fix: dont init playground examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Jan 30, 2025
1 parent 84cb745 commit b6d4891
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/fern-docs/ui/src/atoms/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ import { EDGE_FLAGS_ATOM } from "./flags";
import { useAtomEffect } from "./hooks";
import { HEADER_HEIGHT_ATOM } from "./layout";
import { LOCATION_ATOM } from "./location";
import { CURRENT_NODE_ATOM, NAVIGATION_NODES_ATOM } from "./navigation";
import {
CURRENT_NODE_ATOM,
DOMAIN_ATOM,
NAVIGATION_NODES_ATOM,
} from "./navigation";
import { atomWithStorageValidation } from "./utils/atomWithStorageValidation";
import { IS_MOBILE_SCREEN_ATOM } from "./viewport";

Expand Down Expand Up @@ -437,6 +441,8 @@ export function useOpenPlayground(): (
return useAtomCallback(
useCallbackOne(
async (get, set, node?: FernNavigation.NavigationNodeApiLeaf) => {
const domain = get(DOMAIN_ATOM);

if (!get(HAS_API_PLAYGROUND)) {
set(PLAYGROUND_NODE_ID, undefined);
return;
Expand Down Expand Up @@ -497,7 +503,10 @@ export function useOpenPlayground(): (
formStateAtom,
getInitialEndpointRequestFormStateWithExample(
context,
context.endpoint.examples?.[0],
// HACKHACK: twelvelabs
domain.includes("twelvelabs")
? undefined
: context.endpoint.examples?.[0],
playgroundInitialState
)
);
Expand Down

0 comments on commit b6d4891

Please sign in to comment.