Skip to content

Commit

Permalink
protocol parameters fetching fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vsubhuman committed Nov 21, 2024
1 parent 7e53687 commit 7111790
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/yoroi-extension/app/containers/wallet/WalletSendPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import AddNFTDialog from '../../components/wallet/send/WalletSendFormSteps/AddNF
import AddTokenDialog from '../../components/wallet/send/WalletSendFormSteps/AddTokenDialog';
import { ampli } from '../../../ampli/index';
import { getNetworkById } from '../../api/ada/lib/storage/database/prepackaged/networks';
import LoadingSpinner from '../../components/widgets/LoadingSpinner';
import VerticallyCenteredLayout from '../../components/layout/VerticallyCenteredLayout';
import FullscreenLayout from '../../components/layout/FullscreenLayout';

const messages = defineMessages({
txConfirmationLedgerNanoLine1: {
Expand Down Expand Up @@ -145,7 +148,13 @@ class WalletSendPage extends Component<AllProps> {
} = this.props.stores;

if (!protocolParameters.loadProtocolParametersRequest.wasExecuted) {
return null;
return (
<FullscreenLayout bottomPadding={0}>
<VerticallyCenteredLayout>
<LoadingSpinner />
</VerticallyCenteredLayout>
</FullscreenLayout>
);
}

const { actions } = this.props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class ProtocolParametersStore<
async loadProtocolParameters(): Promise<void> {
for (const key of Object.keys(networks)) {
const networkId = networks[key].NetworkId;
if (networkId === networks.CardanoSanchoTestnet.NetworkId) continue;
const protocolParameters = await getProtocolParameters({ networkId });
this.cache.set(networkId, protocolParameters);
}
Expand Down

0 comments on commit 7111790

Please sign in to comment.