Skip to content

Commit

Permalink
Fix Flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
neuodev committed Jan 18, 2022
1 parent b92c96b commit f97dcd9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/yoroi-extension/app/containers/wallet/Wallet.js
Expand Up @@ -97,6 +97,7 @@ class Wallet extends Component<AllProps> {

renderOverlay(): null | React$Element<typeof WalletSyncingOverlay> {
const publicDeriver = this.generated.stores.wallets.selected;
if (publicDeriver == null) throw new Error(`${nameof(this.renderOverlay)} no public deriver`);

if (this.generated.stores.wallets.firstSync === publicDeriver.getPublicDeriverId()) {
return (
Expand Down Expand Up @@ -254,7 +255,7 @@ class Wallet extends Component<AllProps> {
|},
wallets: {|
selected: null | PublicDeriver<>,
firstSync: boolean,
firstSync: ?number,
|},
router: {| location: any |},
transactions: {|
Expand Down
Expand Up @@ -34,14 +34,13 @@ export const mockWalletProps: {
stores: {
app: {
currentRoute: request.location,

},
profile: {
isClassicTheme: true
},
wallets: {
selected: request.selected,
firstSync: false,
firstSync: null,
},
transactions: {
getBalanceRequest: {
Expand Down
4 changes: 2 additions & 2 deletions packages/yoroi-extension/app/stores/toplevel/WalletStore.js
Expand Up @@ -93,7 +93,7 @@ export default class WalletStore extends Store<StoresMap, ActionsMap> {
WALLET_REFRESH_INTERVAL: number = environment.getWalletRefreshInterval();
ON_VISIBLE_DEBOUNCE_WAIT: number = 1000;

@observable firstSync: null | number;
@observable firstSync: ?number;
@observable publicDerivers: Array<PublicDeriver<>>;
@observable selected: null | PublicDeriver<>;
@observable getInitialWallets: Request<GetWalletsFunc> = new Request<GetWalletsFunc>(getWallets);
Expand Down Expand Up @@ -239,7 +239,7 @@ export default class WalletStore extends Store<StoresMap, ActionsMap> {
await this.stores.addresses.refreshAddressesFromDb(publicDeriver);

await updateSyncedWallets(publicDeriver)
if (this.firstSync) {
if (typeof this.firstSync === 'number') {
runInAction(() => {
this.firstSync = null
})
Expand Down

0 comments on commit f97dcd9

Please sign in to comment.