mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
fix: program exception when Awesome data is empty (#248)
This commit is contained in:
4
src/view/about/index.scss
vendored
4
src/view/about/index.scss
vendored
@@ -7,6 +7,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.markdown-body {
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.about-tab {
|
||||
.imgs {
|
||||
img {
|
||||
|
||||
22
src/view/dashboard/index.tsx
vendored
22
src/view/dashboard/index.tsx
vendored
@@ -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<string, any>) => {
|
||||
await invoke('wa_window', {
|
||||
|
||||
Reference in New Issue
Block a user