mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 11:42:21 +08:00
fix: profile updated field
This commit is contained in:
parent
743788135f
commit
e9b7ec735f
|
@ -380,8 +380,7 @@ impl Profiles {
|
||||||
patch!(each, item, url);
|
patch!(each, item, url);
|
||||||
patch!(each, item, selected);
|
patch!(each, item, selected);
|
||||||
patch!(each, item, extra);
|
patch!(each, item, extra);
|
||||||
|
patch!(each, item, updated);
|
||||||
each.updated = Some(help::get_now());
|
|
||||||
|
|
||||||
self.items = Some(items);
|
self.items = Some(items);
|
||||||
return self.save_file();
|
return self.save_file();
|
||||||
|
|
|
@ -75,7 +75,7 @@ const ProxyGroup = ({ group }: Props) => {
|
||||||
} else {
|
} else {
|
||||||
profile.selected[index] = { name: group.name, now: name };
|
profile.selected[index] = { name: group.name, now: name };
|
||||||
}
|
}
|
||||||
await patchProfile(profiles!.current!, profile);
|
await patchProfile(profiles!.current!, { selected: profile.selected });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,10 @@ const ProfilePage = () => {
|
||||||
name,
|
name,
|
||||||
now,
|
now,
|
||||||
}));
|
}));
|
||||||
patchProfile(current!, profile).catch(console.error);
|
|
||||||
|
patchProfile(current!, { selected: profile.selected }).catch(
|
||||||
|
console.error
|
||||||
|
);
|
||||||
// update proxies cache
|
// update proxies cache
|
||||||
if (hasChange) mutate("getProxies", getProxies());
|
if (hasChange) mutate("getProxies", getProxies());
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
|
@ -35,7 +35,7 @@ export async function deleteProfile(index: string) {
|
||||||
|
|
||||||
export async function patchProfile(
|
export async function patchProfile(
|
||||||
index: string,
|
index: string,
|
||||||
profile: CmdType.ProfileItem
|
profile: Partial<CmdType.ProfileItem>
|
||||||
) {
|
) {
|
||||||
return invoke<void>("patch_profile", { index, profile });
|
return invoke<void>("patch_profile", { index, profile });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user