fix: fix page undefined exception, close #770
This commit is contained in:
parent
ad228d53b7
commit
16d80718cb
@ -63,11 +63,12 @@ const ProfilePage = () => {
|
|||||||
const type1 = ["local", "remote"];
|
const type1 = ["local", "remote"];
|
||||||
const type2 = ["merge", "script"];
|
const type2 = ["merge", "script"];
|
||||||
|
|
||||||
const regularItems = items.filter((i) => type1.includes(i.type!));
|
const regularItems = items.filter((i) => i && type1.includes(i.type!));
|
||||||
const restItems = items.filter((i) => type2.includes(i.type!));
|
const restItems = items.filter((i) => i && type2.includes(i.type!));
|
||||||
const restMap = Object.fromEntries(restItems.map((i) => [i.uid, i]));
|
const restMap = Object.fromEntries(restItems.map((i) => [i.uid, i]));
|
||||||
const enhanceItems = chain
|
const enhanceItems = chain
|
||||||
.map((i) => restMap[i]!)
|
.map((i) => restMap[i]!)
|
||||||
|
.filter(Boolean)
|
||||||
.concat(restItems.filter((i) => !chain.includes(i.uid)));
|
.concat(restItems.filter((i) => !chain.includes(i.uid)));
|
||||||
|
|
||||||
return { regularItems, enhanceItems };
|
return { regularItems, enhanceItems };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user