diff --git a/UPDATE_LOG.md b/UPDATE_LOG.md index e4322b6..0585ac3 100644 --- a/UPDATE_LOG.md +++ b/UPDATE_LOG.md @@ -1,5 +1,11 @@ # UPDATE LOG +## v0.10.1 + +Fix: + +- Program exception when `Awesome` data is empty (https://github.com/lencx/ChatGPT/issues/248) + ## v0.10.0 Fix: diff --git a/src/components/SwitchOrigin/index.tsx b/src/components/SwitchOrigin/index.tsx index e9fd427..dd910a3 100644 --- a/src/components/SwitchOrigin/index.tsx +++ b/src/components/SwitchOrigin/index.tsx @@ -18,6 +18,11 @@ const SwitchOrigin: FC = ({ name }) => { const originName = `${name}_origin`; const isEnable = Form.useWatch(dashboardName, form); + let urlList = [{ title: 'ChatGPT', url: 'https://chat.openai.com', init: true }]; + if (Array.isArray(list)) { + urlList = urlList.concat(list); + } + return ( <> = ({ name }) => { name={originName} > diff --git a/src/view/about/index.scss b/src/view/about/index.scss index 408924f..2e2cfee 100644 --- a/src/view/about/index.scss +++ b/src/view/about/index.scss @@ -7,6 +7,10 @@ } } + .markdown-body { + background-color: unset; + } + .about-tab { .imgs { img { diff --git a/src/view/dashboard/index.tsx b/src/view/dashboard/index.tsx index 1b97d41..ef5a8a1 100644 --- a/src/view/dashboard/index.tsx +++ b/src/view/dashboard/index.tsx @@ -29,15 +29,19 @@ export default function Dashboard() { if (!json) return; const categories = new Map(); - json?.forEach((i) => { - if (!i.enable) return; - if (!categories.has(i.category)) { - categories.set(i.category, []); - } - categories.get(i?.category).push(i); - }); - setList(Array.from(categories)); - }, [json?.length]); + if (Array.isArray(json)) { + json?.forEach((i) => { + if (!i.enable) return; + if (!categories.has(i.category)) { + categories.set(i.category, []); + } + categories.get(i?.category).push(i); + }); + setList(Array.from(categories) || []); + } else { + setList([]); + } + }, [JSON.stringify(json)]); const handleLink = async (item: Record) => { await invoke('wa_window', {