Skip to content

Commit

Permalink
fix: openfoodfacts#2362 history not refreshing (openfoodfacts#2393)
Browse files Browse the repository at this point in the history
* fix: openfoodfacts#2362 history not refreshing

* fix:openfoodfacts#2362 refactoring codereview

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
  • Loading branch information
cli1005 and monsieurtanuki authored Jun 30, 2022
1 parent b0ed802 commit 061fa6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class ContinuousScanModel with ChangeNotifier {
_latestFoundBarcode = product.barcode;
_daoProductList.push(productList, _latestFoundBarcode!);
_daoProductList.push(_history, _latestFoundBarcode!);
_daoProductList.localDatabase.notifyListeners();
}
_setBarcodeState(product.barcode!, state);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/smooth_app/lib/database/dao_product_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ class DaoProductList extends AbstractDao {
/// One barcode duplicate is potentially removed:
/// * If the barcode was already there, it's moved to the end of the list.
/// * If the barcode wasn't there, it's added to the end of the list.
void push(final ProductList productList, final String barcode) {
void push(
final ProductList productList,
final String barcode,
) {
final _BarcodeList? list = _get(productList);
final List<String> barcodes;
if (list == null) {
Expand Down

0 comments on commit 061fa6e

Please sign in to comment.