mirror of
https://github.com/CrazyJasonwell/clash-verge-rev.git
synced 2026-10-19 19:55:41 +08:00
fix: fix page undefined exception, close #770
This commit is contained in:
1 parent
efa7529c5c
commit
19ccd35f3f
1 file changed
+3
-2
@@ -63,11 +63,12 @@ const ProfilePage = () => {
|
||||
const type1 = ["local", "remote"];
|
||||
const type2 = ["merge", "script"];
|
||||
|
||||
const regularItems = items.filter((i) => type1.includes(i.type!));
|
||||
const restItems = items.filter((i) => type2.includes(i.type!));
|
||||
const regularItems = items.filter((i) => i && type1.includes(i.type!));
|
||||
const restItems = items.filter((i) => i && type2.includes(i.type!));
|
||||
const restMap = Object.fromEntries(restItems.map((i) => [i.uid, i]));
|
||||
const enhanceItems = chain
|
||||
.map((i) => restMap[i]!)
|
||||
.filter(Boolean)
|
||||
.concat(restItems.filter((i) => !chain.includes(i.uid)));
|
||||
|
||||
return { regularItems, enhanceItems };
|
||||
|
||||
Reference in new issue
Block a user