Skip to content

Commit

Permalink
feat: show all the unseen changelogs on changelog section (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAabedKhan authored Jun 30, 2023
1 parent 4100d7a commit 6fe05cd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/services/github_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import 'package:flutter/foundation.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:injectable/injectable.dart';
import 'package:revanced_manager/models/patch.dart';
import 'package:revanced_manager/services/manager_api.dart';


@lazySingleton
class GithubAPI {
Expand Down Expand Up @@ -63,7 +65,16 @@ class GithubAPI {
final response = await _dio.get(
'/repos/$repoName/releases',
);
return response.data[0];
final Map<String, dynamic> releases = response.data[0];
int updates = 0;
final String currentVersion = await ManagerAPI().getCurrentManagerVersion();
while (response.data[updates]['tag_name'] != 'v$currentVersion') {
updates++;
}
for(int i = 1; i < updates; i++){
releases.update('body', (value) => value + '\n' + '# '+ response.data[i]['tag_name']+'\n' + response.data[i]['body']);
}
return releases;
} on Exception catch (e) {
if (kDebugMode) {
print(e);
Expand Down

0 comments on commit 6fe05cd

Please sign in to comment.