mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-02 05:24:47 -05:00
feat(swap): Start wallets and tor client in parallel (#198)
CLI + GUI: At startup the wallets and tor client are started in parallel. This will speed up the startup time of the application.
This commit is contained in:
parent
6cd228fada
commit
689dd89e72
7 changed files with 386 additions and 289 deletions
|
|
@ -69,10 +69,26 @@ export const rpcSlice = createSlice({
|
|||
slice,
|
||||
action: PayloadAction<TauriContextStatusEvent>,
|
||||
) {
|
||||
slice.status = action.payload;
|
||||
// If we are already initializing, and we receive a new partial status, we update the existing status
|
||||
if (slice.status?.type === "Initializing" && action.payload.type === "Initializing") {
|
||||
for (const partialStatus of action.payload.content) {
|
||||
// We find the existing status with the same type
|
||||
const existingStatus = slice.status.content.find(s => s.componentName === partialStatus.componentName);
|
||||
if (existingStatus) {
|
||||
// If we find it, we update the content
|
||||
existingStatus.progress = partialStatus.progress;
|
||||
} else {
|
||||
// Otherwise, we add the new partial status
|
||||
slice.status.content.push(partialStatus);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Otherwise, we replace the whole status
|
||||
slice.status = action.payload;
|
||||
}
|
||||
},
|
||||
timelockChangeEventReceived(
|
||||
slice,
|
||||
slice: RPCSlice,
|
||||
action: PayloadAction<TauriTimelockChangeEvent>
|
||||
) {
|
||||
if (slice.state.swapInfos[action.payload.swap_id]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue