mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 09:07:47 +01:00
fix: set isRooted state at RootCheckerView init
This commit is contained in:
parent
db02dc623f
commit
5e8e090e34
2 changed files with 5 additions and 0 deletions
|
@ -11,6 +11,7 @@ class RootCheckerView extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<RootCheckerViewModel>.reactive(
|
||||
onModelReady: (model) => model.initialize(),
|
||||
viewModelBuilder: () => RootCheckerViewModel(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
|
|
|
@ -10,6 +10,10 @@ class RootCheckerViewModel extends BaseViewModel {
|
|||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
bool isRooted = false;
|
||||
|
||||
void initialize() {
|
||||
isRooted = _managerAPI.isRooted() ?? false;
|
||||
}
|
||||
|
||||
Future<void> navigateAsRoot() async {
|
||||
bool? res = await Root.isRooted();
|
||||
isRooted = res != null && res == true;
|
||||
|
|
Loading…
Reference in a new issue