diff --git a/components/profile/ProfileButtonAction.tsx b/components/profile/ProfileButtonAction.tsx index 9805832..b84e671 100644 --- a/components/profile/ProfileButtonAction.tsx +++ b/components/profile/ProfileButtonAction.tsx @@ -75,8 +75,12 @@ function ProfileButtonAction({ }; const handleStartProcess = useCallback(() => { - processJsonDownloaded(); - setIsDownload(true); + if (isMdPreview) { + processJsonDownloaded(); + setIsDownload(true); + } else { + toast.warn("Please Switch Preview Code"); + } }, [isDownLoad]); const handleDownloadJson = (value: ProfileAtomDetails) => { @@ -143,7 +147,7 @@ function ProfileButtonAction({ className="bg-gray-700 text-gray-300 hover:bg-slate-600 dark:bg-gray-300 dark:hover:bg-gray-400 dark:text-gray-800 font-bold py-2 px-4 rounded inline-flex items-center gap-2" > - Save Markdown + Download Backup diff --git a/lib/request.ts b/lib/request.ts index 17471a7..b86256a 100644 --- a/lib/request.ts +++ b/lib/request.ts @@ -26,8 +26,7 @@ const Request = () => { const fetchData = async () => { try { const skills: SkillsType = await fetch( - "https://globalmusicbeats.github.io/skill/Skills.json" - /* process.env.NEXT_PUBLIC_SKILL_API_KEY! */ + process.env.NEXT_PUBLIC_SKILL_API_KEY! ).then((res) => res.json()); setSkills(skills);