Skip to content

Commit

Permalink
fix: No API migration was happening
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAabedKhan committed Oct 9, 2024
1 parent 0931782 commit 4447b75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/services/manager_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ class ManagerAPI {
}

// Migrate to new API URL if not done yet as the old one is sunset.
final bool hasMigratedToNewApi =
_prefs.getBool('migratedToNewApiUrl') ?? false;
if (!hasMigratedToNewApi) {
final bool hasMigratedToLatestApi =
_prefs.getBool('migratedToLatestApiUrl') ?? false;
if (!hasMigratedToLatestApi) {
final String apiUrl = getApiUrl().toLowerCase();
if (apiUrl.contains('releases.revanced.app') ||
(apiUrl.contains('api.revanced.app') &&
!apiUrl.contains('v3'))) {
await setApiUrl(''); // Reset to default.
_prefs.setBool('migratedToNewApiUrl', true);
_prefs.setBool('migratedToLatestApiUrl', true);
}
}

Expand Down

0 comments on commit 4447b75

Please sign in to comment.