Skip to content

Commit

Permalink
Hide cancel button when updates are not in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
codinesh committed Jan 3, 2024
1 parent 9499f9a commit 94220a5
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions packages/app_center/lib/src/manage/manage_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,18 @@ class _ActionButtons extends ConsumerWidget {
],
),
),
const SizedBox(width: 8),
PushButton.outlined(
onPressed: updatesInprogress
? () => ref
.read(updatesModelProvider)
.cancelChange(updatesModel.activeChangeId!)
: null,
child: Text(
l10n.snapActionCancelLabel,
maxLines: 1,
overflow: TextOverflow.ellipsis,
if (updatesInprogress) const SizedBox(width: 8),
if (updatesInprogress)
PushButton.outlined(
onPressed: () => ref
.read(updatesModelProvider)
.cancelChange(updatesModel.activeChangeId!),
child: Text(
l10n.snapActionCancelLabel,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
],
);
}
Expand Down

0 comments on commit 94220a5

Please sign in to comment.