Skip to content

Commit

Permalink
download fixes for fabrication files
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Oct 15, 2024
1 parent 0a4b3a1 commit e1a33ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"circuit-json": "^0.0.85",
"circuit-json-to-bom-csv": "^0.0.4",
"circuit-json-to-gerber": "^0.0.12",
"circuit-json-to-pnp-csv": "^0.0.5",
"circuit-json-to-pnp-csv": "^0.0.6",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "1.0.0",
Expand Down
14 changes: 10 additions & 4 deletions src/components/DownloadButtonAndMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { Button } from "@/components/ui/button"
import { Download, ChevronDown } from "lucide-react"
import { downloadCircuitJson } from "@/lib/download-fns/download-circuit-json-fn"
import { useNotImplementedToast } from "@/hooks/use-toast"
import { toast, useNotImplementedToast } from "@/hooks/use-toast"
import { downloadFabricationFiles } from "@/lib/download-fns/download-fabrication-files"
import { AnyCircuitElement } from "circuit-json"

Expand Down Expand Up @@ -72,12 +72,18 @@ export function DownloadButtonAndMenu({
</DropdownMenuItem>
<DropdownMenuItem
className="text-xs"
onClick={() =>
downloadFabricationFiles({
onClick={async () => {
await downloadFabricationFiles({
circuitJson,
snippetUnscopedName: snippetUnscopedName || "snippet",
}).catch((error) => {
console.error(error)
toast({
title: "Error Downloading Fabrication Files",
description: error.toString(),
})
})
}
}}
>
<Download className="mr-1 h-3 w-3" />
<span className="flex-grow mr-6">Fabrication Files</span>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/view-snippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export const ViewSnippetPage = () => {
},
)

console.log({ snippet, snippetError, isLoading })

return (
<div>
<Header />
Expand Down

0 comments on commit e1a33ae

Please sign in to comment.