mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Fixed the issue where addHistoryAsync
did not update the cache.
This commit is contained in:
@@ -256,6 +256,16 @@ class HistoryManager with ChangeNotifier {
|
||||
_haveAsyncTask = true;
|
||||
await _addHistoryAsync(_db.handle.address, newItem);
|
||||
_haveAsyncTask = false;
|
||||
if (_cachedHistoryIds == null) {
|
||||
updateCache();
|
||||
} else {
|
||||
_cachedHistoryIds![newItem.id] = true;
|
||||
}
|
||||
cachedHistories[newItem.id] = newItem;
|
||||
if (cachedHistories.length > 10) {
|
||||
cachedHistories.remove(cachedHistories.keys.first);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// add history. if exists, update time.
|
||||
|
Reference in New Issue
Block a user