Skip to content

Commit

Permalink
fix: Do not delete cached downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Oct 1, 2023
1 parent 6e26130 commit 6961bb7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion lib/services/github_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class GithubAPI {
Future<void> clearAllCache() async {
try {
await _cacheOptions.store!.clean();
await DefaultCacheManager().emptyCache();
} on Exception catch (e) {
if (kDebugMode) {
print(e);
Expand Down
1 change: 0 additions & 1 deletion lib/services/revanced_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class RevancedAPI {
Future<void> clearAllCache() async {
try {
await _cacheOptions.store!.clean();
await DefaultCacheManager().emptyCache();
} on Exception catch (e) {
if (kDebugMode) {
print(e);
Expand Down
6 changes: 1 addition & 5 deletions lib/ui/views/home/home_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,7 @@ class HomeViewModel extends BaseViewModel {
}

Future<void> forceRefresh(BuildContext context) async {
await Future.delayed(const Duration(seconds: 1));
if (_lastUpdate == null ||
_lastUpdate!.difference(DateTime.now()).inSeconds > 2) {
_managerAPI.clearAllData();
}
_managerAPI.clearAllData();
_toast.showBottom('homeView.refreshSuccess');
initialize(context);
}
Expand Down

0 comments on commit 6961bb7

Please sign in to comment.