Skip to content

Commit

Permalink
Added isSigned should show broadcast button
Browse files Browse the repository at this point in the history
  • Loading branch information
i5hi committed Jun 13, 2024
1 parent bdab41a commit b31ca6a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/settings/broadcast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ class _Screen extends StatelessWidget {
const _Screen();
@override
Widget build(BuildContext context) {
final signed =
context.select((BroadcastTxCubit cubit) => cubit.state.isSigned);

return Padding(
padding: const EdgeInsets.symmetric(
vertical: 16,
Expand Down Expand Up @@ -206,7 +203,7 @@ class _Screen extends StatelessWidget {
const _TxTextField(),
],
const Gap(80),
if (!signed) const BroadcastSendButton(),
const BroadcastSendButton(),
const Gap(48),
],
),
Expand Down Expand Up @@ -292,6 +289,8 @@ class BroadcastSendButton extends StatelessWidget {
final loading = broadcasting || extractingTx;

final sent = context.select((BroadcastTxCubit cubit) => cubit.state.sent);
final signed =
context.select((BroadcastTxCubit cubit) => cubit.state.isSigned);

if (sent)
return const Center(
Expand All @@ -318,7 +317,7 @@ class BroadcastSendButton extends StatelessWidget {
// if (loading) return;
if (step == BroadcastTxStep.import)
context.read<BroadcastTxCubit>().extractTxClicked();
if (step == BroadcastTxStep.broadcast)
if (step == BroadcastTxStep.broadcast && signed)
context.read<BroadcastTxCubit>().broadcastClicked();
},
label: (step == BroadcastTxStep.import) ? 'Decode' : 'Broadcast',
Expand Down

0 comments on commit b31ca6a

Please sign in to comment.