mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: fix broken manager update implmentation
This commit is contained in:
parent
d2e8e7dd5d
commit
15a32a18b7
@ -17,6 +17,7 @@ class HomeView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<HomeViewModel>.reactive(
|
||||
disposeViewModel: false,
|
||||
fireOnViewModelReadyOnce: true,
|
||||
onViewModelReady: (model) => model.initialize(context),
|
||||
viewModelBuilder: () => locator<HomeViewModel>(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
|
@ -116,7 +116,13 @@ class HomeViewModel extends BaseViewModel {
|
||||
|
||||
Future<bool> hasManagerUpdates() async {
|
||||
final String? latestVersion = await _managerAPI.getLatestManagerVersion();
|
||||
final String currentVersion = await _managerAPI.getCurrentManagerVersion();
|
||||
String currentVersion = await _managerAPI.getCurrentManagerVersion();
|
||||
|
||||
// add v to current version
|
||||
if (!currentVersion.startsWith('v')) {
|
||||
currentVersion = 'v$currentVersion';
|
||||
}
|
||||
|
||||
if (latestVersion != currentVersion) {
|
||||
return true;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
],
|
||||
),
|
||||
FutureBuilder<bool>(
|
||||
future: locator<HomeViewModel>().hasManagerUpdates(),
|
||||
future: model.hasManagerUpdates(),
|
||||
initialData: false,
|
||||
builder: (context, snapshot) => Opacity(
|
||||
opacity: snapshot.hasData && snapshot.data! ? 1.0 : 0.25,
|
||||
|
Loading…
Reference in New Issue
Block a user