fix: profile data undefined error, close #566

This commit is contained in:
GyDi 2023-05-18 20:02:46 +08:00 committed by GitHub
parent 8c31629655
commit 6114af4f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ export const useProfiles = () => {
if (!profileData || !proxiesData) return;
const current = profileData.items?.find(
(e) => e.uid === profileData.current
(e) => e && e.uid === profileData.current
);
if (!current) return;
@ -70,7 +70,7 @@ export const useProfiles = () => {
return {
profiles,
current: profiles?.items?.find((p) => p.uid === profiles.current),
current: profiles?.items?.find((p) => p && p.uid === profiles.current),
activateSelected,
patchProfiles,
patchCurrent,