Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(manage): show progress in 'update all' button #1333

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

d-loose
Copy link
Member

@d-loose d-loose commented Aug 15, 2023

  • Disable refresh button when an update is in progress
  • Disable 'update all' button while checking for updates
  • Show progress indicator in the 'update all' button during an update (similar to the primary action button on the detail page)

Copy link

@CarlosNihelton CarlosNihelton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏽

My questions are more for my own learning.

onPressed: ref.read(updatesModelProvider).refresh,
onPressed: updatesModel.activeChangeId != null
? null
: ref.read(updatesModelProvider).refresh,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honest question: you cannot reuse the updatesModel local variable because it was created with ref.watch, can you?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you totally can, thanks for spotting!
It's just a force of habit to always use read when calling methods on a provider

child: updatesModel.activeChangeId != null
? Consumer(
builder: (context, ref, child) {
final change = ref

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another honest question: change can never be null if updatesModel.activeChangeId is not null, can it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check my understanding.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's null while the changeProvider, which gives an AsyncValue<SnapdChange>, is fetching the data from snapd

@d-loose d-loose enabled auto-merge (squash) August 15, 2023 15:39
@d-loose d-loose merged commit e607c46 into ubuntu:dev Aug 15, 2023
6 checks passed
@d-loose d-loose deleted the refresh-button branch August 15, 2023 15:48
kenvandine pushed a commit that referenced this pull request Aug 15, 2023
* move snap l10n extensions into separate file

* show change progress in 'update all' button

* update tests, leave todo notes

* add 'updating' l10n string

* re-use updatesModel
tim-hm pushed a commit to tim-hm/app-center that referenced this pull request Sep 1, 2023
* move snap l10n extensions into separate file

* show change progress in 'update all' button

* update tests, leave todo notes

* add 'updating' l10n string

* re-use updatesModel
tim-hm pushed a commit to tim-hm/app-center that referenced this pull request Sep 1, 2023
* move snap l10n extensions into separate file

* show change progress in 'update all' button

* update tests, leave todo notes

* add 'updating' l10n string

* re-use updatesModel
ashuntu pushed a commit to ashuntu/app-center that referenced this pull request Feb 28, 2024
* move snap l10n extensions into separate file

* show change progress in 'update all' button

* update tests, leave todo notes

* add 'updating' l10n string

* re-use updatesModel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants