Skip to content

Commit

Permalink
Merge pull request #1557 from codinesh/fix/managepage-cancel-updates-…
Browse files Browse the repository at this point in the history
…hide

fix: Manage page: Hide cancel button when updates are not in progress.
  • Loading branch information
BLKKKBVSIK authored Jan 16, 2024
2 parents 9cdc3e5 + fe8d993 commit 8eb0247
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions packages/app_center/lib/src/manage/manage_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ class _ActionButtons extends ConsumerWidget {
final updatesInprogress = updatesModel.refreshableSnapNames.isNotEmpty &&
!updatesModel.state.isLoading &&
updatesModel.activeChangeId != null;
return Row(
mainAxisSize: MainAxisSize.min,
return Wrap(
spacing: 10,
runSpacing: 10,
children: [
PushButton.outlined(
onPressed:
Expand All @@ -259,7 +260,6 @@ class _ActionButtons extends ConsumerWidget {
],
),
),
const SizedBox(width: 8),
PushButton.elevated(
onPressed: updatesModel.refreshableSnapNames.isNotEmpty &&
!updatesModel.state.isLoading &&
Expand Down Expand Up @@ -308,19 +308,17 @@ 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)
PushButton.outlined(
onPressed: () => ref
.read(updatesModelProvider)
.cancelChange(updatesModel.activeChangeId!),
child: Text(
l10n.snapActionCancelLabel,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
],
);
}
Expand Down

0 comments on commit 8eb0247

Please sign in to comment.