Skip to content

Commit

Permalink
Revert "fix: Use the template at initialization (#413)" (#416)
Browse files Browse the repository at this point in the history
This reverts commit 2e03d37.
  • Loading branch information
seveibar authored Dec 24, 2024
1 parent 2e03d37 commit 1fbc70a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/CodeAndPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { useMutation, useQueryClient } from "react-query"
import EditorNav from "./EditorNav"
import { PreviewContent } from "./PreviewContent"
import { parseJsonOrNull } from "@/lib/utils/parseJsonOrNull"
import manualEditsTemplate from "@/lib/templates/manual-edits-template"

interface Props {
snippet?: Snippet | null
Expand Down Expand Up @@ -45,10 +44,7 @@ export function CodeAndPreview({ snippet }: Props) {
// Initialize with template or snippet's manual edits if available
const [manualEditsFileContent, setManualEditsFileContent] = useState<
string | null
>(
snippet?.manual_edits_json_content ??
JSON.stringify(manualEditsTemplate, null, 2),
)
>(null)
const [code, setCode] = useState(defaultCode ?? "")
const [dts, setDts] = useState("")
const [showPreview, setShowPreview] = useState(true)
Expand Down
1 change: 1 addition & 0 deletions src/components/CodeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useSnippetsBaseApiUrl } from "@/hooks/use-snippets-base-api-url"
import { basicSetup } from "@/lib/codemirror/basic-setup"
import manualEditsTemplate from "@/lib/templates/manual-edits-template"
import { autocompletion } from "@codemirror/autocomplete"
import { indentWithTab } from "@codemirror/commands"
import { javascript } from "@codemirror/lang-javascript"
Expand Down

0 comments on commit 1fbc70a

Please sign in to comment.