mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-26 11:16:45 +08:00
feat: 5099 - new dev mode item to refresh all the products from the server (#5100)
Impacted files: * `dao_product.dart`: new method `clearAllLanguages` * `pubspec.lock`: wtf * `user_preferences_dev_mode.dart`: added a "Refresh all products from server (cf. Nutriscore v2)" item
This commit is contained in:
@ -302,4 +302,15 @@ class DaoProduct extends AbstractSqlDao implements BulkDeletable {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Sets the language of all products to null.
|
||||
///
|
||||
/// This is useful to refresh the whole database, as products without language
|
||||
/// are easy to detect. And therefore we can say "refresh all the products
|
||||
/// with a language null or different from the current app language", and use
|
||||
/// the same mechanism as "switch language and refresh products accordingly".
|
||||
Future<int> clearAllLanguages() async => localDatabase.database.update(
|
||||
_TABLE_PRODUCT,
|
||||
<String, Object?>{_TABLE_PRODUCT_COLUMN_LANGUAGE: null},
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user