mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
fix: Follow language update immediately (#1944)
Co-authored-by: surya-technovert <surya.m@technovert.com>
This commit is contained in:
parent
e0a6de2c2b
commit
c13827e8e1
1 changed files with 5 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:language_code/language_code.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/app/app.router.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/toast.dart';
|
||||
|
@ -10,8 +11,10 @@ import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
|||
import 'package:revanced_manager/ui/widgets/settingsView/settings_tile_dialog.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
final _settingViewModel = SettingsViewModel();
|
||||
final _navigationService = NavigationService();
|
||||
|
||||
class SUpdateLanguage extends BaseViewModel {
|
||||
final Toast _toast = locator<Toast>();
|
||||
|
@ -108,10 +111,9 @@ class SUpdateLanguage extends BaseViewModel {
|
|||
child: Text(t.cancelButton),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
// TODO(nullcube): Translation will not update until we refresh the page.
|
||||
onPressed: () async {
|
||||
updateLocale(selectedLanguageCode.value.languageTag);
|
||||
Navigator.of(context).pop();
|
||||
await _navigationService.navigateToNavigationView();
|
||||
},
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue