feat: 4-tab major redesign: Search, Favorites, History & Collections v2.1.0
This commit is contained in:
@@ -47,6 +47,12 @@ class SearchRepository {
|
||||
});
|
||||
}
|
||||
|
||||
Future<Result<bool>> delete(String historyId) {
|
||||
return _databaseService.safeWrite((isar) async {
|
||||
return await isar.searchHistoryEntitys.deleteByHistoryId(historyId);
|
||||
});
|
||||
}
|
||||
|
||||
Future<Result<void>> clear() {
|
||||
return _databaseService.safeWrite((isar) async {
|
||||
await isar.searchHistoryEntitys.clear();
|
||||
|
||||
@@ -51,6 +51,14 @@ class ViewedPostRepository {
|
||||
});
|
||||
}
|
||||
|
||||
Future<Result<void>> deleteItem(String providerId, String postId) {
|
||||
return _databaseService.safeWrite((isar) async {
|
||||
await isar.viewedPostEntitys.deleteByViewedKey(
|
||||
ViewedPost.keyFor(providerId, postId),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Future<Result<void>> clear() {
|
||||
return _databaseService.safeWrite((isar) async {
|
||||
await isar.viewedPostEntitys.clear();
|
||||
|
||||
@@ -161,6 +161,9 @@ class SearchService {
|
||||
return Success(sorted.take(limit).toList(growable: false));
|
||||
}
|
||||
|
||||
Future<Result<bool>> deleteHistoryItem(String historyId) =>
|
||||
_repository.delete(historyId);
|
||||
|
||||
Future<Result<void>> clearHistory() => _repository.clear();
|
||||
|
||||
Future<void> clearTagCache() async {
|
||||
|
||||
@@ -59,6 +59,10 @@ class ViewedHistoryService {
|
||||
]);
|
||||
}
|
||||
|
||||
Future<Result<void>> deleteItem(String providerId, String postId) {
|
||||
return _repository.deleteItem(providerId, postId);
|
||||
}
|
||||
|
||||
Future<Result<void>> clearHistory() {
|
||||
return _repository.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user