refactor: добавить вызов flush после инициализации данных

This commit is contained in:
2025-06-09 17:39:07 +03:00
committed by Sanders
parent 75c3b4c69a
commit 881f57b70a
+3
View File
@@ -55,18 +55,21 @@ class HiveService {
if (catBox.isEmpty) {
_logger.i('Filling initial categories');
await catBox.addAll(CategoryUtils.getDefaultCategories());
await catBox.flush();
}
final tagBox = tags;
if (tagBox.isEmpty) {
_logger.i('Filling initial tags');
await tagBox.addAll(TagUtils.getDefaultTags());
await tagBox.flush();
}
final transactionBox = transactions;
if (transactionBox.isEmpty) {
_logger.i('Filling sample transactions');
await transactionBox.addAll(TransactionUtils.getSampleTransactions());
await transactionBox.flush();
}
}
}