Obtainium now installs last (#84)

This commit is contained in:
Imran Remtulla
2022-10-31 17:41:25 -04:00
parent 9c00a7da14
commit e746ca890a
3 changed files with 6 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ import 'package:workmanager/workmanager.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:device_info_plus/device_info_plus.dart';
const String currentVersion = '0.6.3';
const String currentVersion = '0.6.4';
const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

View File

@@ -302,7 +302,7 @@ class AppsProvider with ChangeNotifier {
}
// If Obtainium is being installed, it should be the last one
List<DownloadedApp> moveObtainiumToEnd(List<DownloadedApp> items) {
List<DownloadedApp> moveObtainiumToStart(List<DownloadedApp> items) {
String obtainiumId = 'imranr98_obtainium_${GitHub().host}';
DownloadedApp? temp;
items.removeWhere((element) {
@@ -313,7 +313,7 @@ class AppsProvider with ChangeNotifier {
return res;
});
if (temp != null) {
items.add(temp!);
items = [temp!, ...items];
}
return items;
}
@@ -321,8 +321,8 @@ class AppsProvider with ChangeNotifier {
// TODO: Remove below line if silentupdates are ever figured out
regularInstalls.addAll(silentUpdates);
silentUpdates = moveObtainiumToEnd(silentUpdates);
regularInstalls = moveObtainiumToEnd(regularInstalls);
silentUpdates = moveObtainiumToStart(silentUpdates);
regularInstalls = moveObtainiumToStart(regularInstalls);
// TODO: Uncomment below if silentupdates are ever figured out
// for (var u in silentUpdates) {