Skip to content

Commit

Permalink
fix: Rename localSnapsProvider to filteredLocalSnapsProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Jul 12, 2024
1 parent 35014d3 commit e742b06
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
3 changes: 1 addition & 2 deletions packages/app_center/lib/manage/local_snap_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ final showLocalSystemAppsProvider = StateProvider<bool>((_) => false);
final localSnapSortOrderProvider =
StateProvider<SnapSortOrder>((_) => SnapSortOrder.alphabeticalAsc);

// TODO: Maybe rename since it is filtered?
@riverpod
class LocalSnaps extends _$LocalSnaps {
class FilteredLocalSnaps extends _$FilteredLocalSnaps {
@override
Future<Iterable<Snap>> build() async {
final nonRefreshableSnaps = await ref.watch(
Expand Down
22 changes: 12 additions & 10 deletions packages/app_center/lib/manage/local_snap_providers.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app_center/lib/manage/manage_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class _ManageView extends ConsumerWidget {
),
Consumer(
builder: (context, ref, _) {
final filteredLocalSnaps = ref.watch(localSnapsProvider);
final filteredLocalSnaps = ref.watch(filteredLocalSnapsProvider);
return filteredLocalSnaps.when(
data: (data) => SliverList.builder(
itemCount: data.length,
Expand Down
3 changes: 2 additions & 1 deletion packages/app_center/lib/snapd/snap_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class SnapPage extends ConsumerWidget {
if (snapDataNotFound) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (Navigator.canPop(context)) {
ref.invalidate(localSnapsProvider);
print('we invalidate');
ref.invalidate(filteredLocalSnapsProvider);
Navigator.pop(context);
}
});
Expand Down

0 comments on commit e742b06

Please sign in to comment.