Skip to content

Commit

Permalink
fix: file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
idootop committed Nov 16, 2024
1 parent 45cefed commit bba19b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Server } from "./services/server";

function App() {
const { status, launch, kill } = useServer();
const { isSwapping, output, swapFace } = useSwapFace();
const { isSwapping, output, swapFace, cancel } = useSwapFace();

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/services/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _Server {
]).execute();
return output.code === 0;
}
return true;
return exists;
} catch (error) {
return false;
}
Expand Down

0 comments on commit bba19b3

Please sign in to comment.