fix: profile updated field

This commit is contained in:
GyDi
2022-03-07 01:41:42 +08:00
parent 743788135f
commit e9b7ec735f
4 changed files with 7 additions and 5 deletions

View File

@@ -75,7 +75,7 @@ const ProxyGroup = ({ group }: Props) => {
} else {
profile.selected[index] = { name: group.name, now: name };
}
await patchProfile(profiles!.current!, profile);
await patchProfile(profiles!.current!, { selected: profile.selected });
} catch (err) {
console.error(err);
}

View File

@@ -81,7 +81,10 @@ const ProfilePage = () => {
name,
now,
}));
patchProfile(current!, profile).catch(console.error);
patchProfile(current!, { selected: profile.selected }).catch(
console.error
);
// update proxies cache
if (hasChange) mutate("getProxies", getProxies());
}, 100);

View File

@@ -35,7 +35,7 @@ export async function deleteProfile(index: string) {
export async function patchProfile(
index: string,
profile: CmdType.ProfileItem
profile: Partial<CmdType.ProfileItem>
) {
return invoke<void>("patch_profile", { index, profile });
}