mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-20 21:47:06 +02:00
fix: reset patches after patching
This commit is contained in:
parent
b07439d402
commit
cd07f39b69
@ -31,7 +31,7 @@ class PatcherAPI {
|
|||||||
File? outFile;
|
File? outFile;
|
||||||
|
|
||||||
Future<void> initialize() async {
|
Future<void> initialize() async {
|
||||||
await _loadPatches();
|
await loadPatches();
|
||||||
await _managerAPI.downloadIntegrations();
|
await _managerAPI.downloadIntegrations();
|
||||||
final Directory appCache = await getTemporaryDirectory();
|
final Directory appCache = await getTemporaryDirectory();
|
||||||
_dataDir = await getExternalStorageDirectory() ?? appCache;
|
_dataDir = await getExternalStorageDirectory() ?? appCache;
|
||||||
@ -62,7 +62,7 @@ class PatcherAPI {
|
|||||||
return _patches.where((patch) => patch.compatiblePackages.isEmpty).toList();
|
return _patches.where((patch) => patch.compatiblePackages.isEmpty).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _loadPatches() async {
|
Future<void> loadPatches() async {
|
||||||
try {
|
try {
|
||||||
if (_patches.isEmpty) {
|
if (_patches.isEmpty) {
|
||||||
_patches = await _managerAPI.getPatches();
|
_patches = await _managerAPI.getPatches();
|
||||||
|
@ -148,9 +148,8 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
|
|
||||||
// Necessary to reset the state of patches by reloading them
|
// Necessary to reset the state of patches by reloading them
|
||||||
// in a later patching process.
|
// in a later patching process.
|
||||||
// TODO(Benjamin): Fix this not working
|
|
||||||
_managerAPI.patches.clear();
|
_managerAPI.patches.clear();
|
||||||
await _managerAPI.getPatches();
|
await _patcherAPI.loadPatches();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (FlutterBackground.isBackgroundExecutionEnabled) {
|
if (FlutterBackground.isBackgroundExecutionEnabled) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user