mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-21 11:25:50 -05:00
feat(gui): Migrate to Tauri events
- Replace Electron IPC with Tauri invoke() for API calls - Implement TauriSwapProgressEvent for state management - Remove IpcInvokeButton, replace with PromiseInvokeButton - Update models: new tauriModel.ts, refactor rpcModel.ts - Simplify SwapSlice state, remove processRunning flag - Refactor SwapStatePage to use TauriSwapProgressEvent - Update HistoryRow and HistoryRowActions for new data structures - Remove unused Electron-specific components (e.g., RpcStatusAlert) - Update dependencies: React 18, Material-UI v4 to v5 - Implement typeshare for Rust/TypeScript type synchronization - Add BobStateName enum for more precise swap state tracking - Refactor utility functions for Tauri compatibility - Remove JSONStream and other Electron-specific dependencies
This commit is contained in:
parent
d54f5c6c77
commit
cf641bc8bb
77 changed files with 2484 additions and 2167 deletions
|
|
@ -17,17 +17,20 @@ export function useResumeableSwapsCount() {
|
|||
}
|
||||
|
||||
export function useIsSwapRunning() {
|
||||
return useAppSelector((state) => state.swap.state !== null);
|
||||
return useAppSelector(
|
||||
(state) =>
|
||||
state.swap.state !== null && state.swap.state.curr.type !== "Released",
|
||||
);
|
||||
}
|
||||
|
||||
export function useSwapInfo(swapId: string | null) {
|
||||
return useAppSelector((state) =>
|
||||
swapId ? state.rpc.state.swapInfos[swapId] ?? null : null,
|
||||
swapId ? (state.rpc.state.swapInfos[swapId] ?? null) : null,
|
||||
);
|
||||
}
|
||||
|
||||
export function useActiveSwapId() {
|
||||
return useAppSelector((s) => s.swap.swapId);
|
||||
return useAppSelector((s) => s.swap.state?.swapId ?? null);
|
||||
}
|
||||
|
||||
export function useActiveSwapInfo() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue