Skip to content

Commit

Permalink
fix: Minor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch committed Dec 19, 2024
1 parent 7c7ac37 commit c5ca676
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions kitchenowl/lib/cubits/shoppinglist_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ class ShoppinglistCubit extends Cubit<ShoppinglistCubitState> {
return _refreshThread!;
}

Future<Map<int, ShoppingList>> fetchShoppingLists(bool forceOffline) async {
Future<Map<int, ShoppingList>> fetchShoppingLists(
[bool forceOffline = false]) async {
final shoppingLists = await TransactionHandler.getInstance()
.runTransaction(
TransactionShoppingListGet(household: household),
Expand All @@ -314,10 +315,10 @@ class ShoppinglistCubit extends Cubit<ShoppinglistCubitState> {
return shoppingLists;
}

Future<List<Category>> fetchCategories(bool forceOffline) {
Future<List<Category>> fetchCategories([bool forceOffline = false]) {
return TransactionHandler.getInstance().runTransaction(
TransactionCategoriesGet(household: household),
forceOffline: true,
forceOffline: forceOffline,
);
}

Expand Down Expand Up @@ -374,7 +375,7 @@ class ShoppinglistCubit extends Cubit<ShoppinglistCubitState> {
));
}

final shoppingLists = await fetchShoppingLists(false);
final shoppingLists = await fetchShoppingLists();

int? selectedShoppinglistId = state.selectedShoppinglistId;
if (selectedShoppinglistId != null &&
Expand All @@ -387,7 +388,7 @@ class ShoppinglistCubit extends Cubit<ShoppinglistCubitState> {

final shoppinglist = shoppingLists[selectedShoppinglistId];

Future<List<Category>> categories = fetchCategories(false);
Future<List<Category>> categories = fetchCategories();

if (query != null && query.isNotEmpty) {
// Split query into name and description
Expand Down

0 comments on commit c5ca676

Please sign in to comment.