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:
binarybaron 2024-11-21 01:51:19 +01:00 committed by GitHub
parent 6cd228fada
commit 689dd89e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 386 additions and 289 deletions

View file

@ -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]) {