Skip to content

Commit

Permalink
fix: saving wallet file on creating new wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
brusherru committed Jun 28, 2022
1 parent 8a33e4c commit 3bb1a4e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions desktop/main/sources/wallet.ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as R from 'ramda';
import {
combineLatest,
delay,
distinctUntilChanged,
filter,
first,
from,
Expand Down Expand Up @@ -332,6 +331,11 @@ const handleWalletIpcRequests = (
next: (next) => {
$wallet.next(next.wallet);
$walletPath.next(next.path);
if (isWalletData(next)) {
updateWalletFile(next).catch((err) => {
logger.error('updateWalletFile', err, next);
});
}
},
error: (error: Error) => {
// TODO: Show error to User
Expand All @@ -341,15 +345,6 @@ const handleWalletIpcRequests = (
logger.error('$nextWallet', 'Observable is completed');
},
}),
// Store new wallet on FS
$nextWallet
.pipe(
skip(1),
distinctUntilChanged(),
filter(isWalletPair),
debounceTime(50)
)
.subscribe(updateWalletFile),
];

return () => subs.forEach((sub) => sub.unsubscribe());
Expand Down

0 comments on commit 3bb1a4e

Please sign in to comment.