MCPcopy
hub / github.com/shiyi-0x7f/o-lib / handleResetHosts

Function handleResetHosts

src/pages/SettingsPage/index.tsx:94–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 };
93
94 const handleResetHosts = async () => {
95 try {
96 const count: number = await invoke("reset_hosts");
97 setSubUrl("");
98 await loadConfig();
99 await loadHostsInfo();
100 pingHosts();
101 alert(`已重置为默认 ${count} 个节点`);
102 } catch (err: any) {
103 alert(`重置失败: ${err}`);
104 }
105 };
106
107 const handleAutoSelect = async () => {
108 setAutoSelecting(true);

Callers

nothing calls this directly

Calls 3

loadConfigFunction · 0.85
loadHostsInfoFunction · 0.85
pingHostsFunction · 0.85

Tested by

no test coverage detected