Skip to content

Commit bba19b3

Browse files
committed
fix: file exists
1 parent 45cefed commit bba19b3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: src/App.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Server } from "./services/server";
1010

1111
function App() {
1212
const { status, launch, kill } = useServer();
13-
const { isSwapping, output, swapFace } = useSwapFace();
13+
const { isSwapping, output, swapFace, cancel } = useSwapFace();
1414

1515
const [rootDir, setRootDir] = useState("");
1616

@@ -38,8 +38,9 @@ function App() {
3838
{status === "idle" && <button onClick={launch}>Launch</button>}
3939
{status === "launching" && <button onClick={kill}>Launching...</button>}
4040
{status === "running" && <button onClick={startSwap}>Swap</button>}
41+
{isSwapping && <button onClick={cancel}>Swapping...</button>}
4142

42-
{status === "launching" && <p>首次加载比较缓慢,请耐心等待...</p>}
43+
{status === "launching" && <p>首次加载较慢,请耐心等待...</p>}
4344

4445
<button onClick={() => download()}>下载测试</button>
4546

Diff for: src/services/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class _Server {
3737
]).execute();
3838
return output.code === 0;
3939
}
40-
return true;
40+
return exists;
4141
} catch (error) {
4242
return false;
4343
}

0 commit comments

Comments
 (0)