mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-02-12 10:10:23 +00:00
feat: init Party Room
This commit is contained in:
@@ -63,10 +63,13 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
||||
|
||||
String get _scInstallPath => ref.read(homeUIModelProvider).scInstalledPath!;
|
||||
|
||||
bool _isDisposed = false;
|
||||
|
||||
@override
|
||||
LocalizationUIState build() {
|
||||
state = LocalizationUIState(selectedLanguage: languageSupport.keys.first);
|
||||
ref.onDispose(() {
|
||||
_isDisposed = true;
|
||||
_customizeDirListenSub?.cancel();
|
||||
_customizeDirListenSub = null;
|
||||
});
|
||||
@@ -83,6 +86,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
||||
state = state.copyWith(selectedLanguage: lang);
|
||||
// fix for ui performance
|
||||
await Future.delayed(Duration(milliseconds: 250));
|
||||
if (_isDisposed) return;
|
||||
await _loadData();
|
||||
}
|
||||
|
||||
@@ -113,6 +117,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
||||
for (var lang in languageSupport.keys) {
|
||||
final l = await Api.getScLocalizationData(lang).unwrap();
|
||||
if (l != null) {
|
||||
if (_isDisposed) return;
|
||||
if (lang == state.selectedLanguage) {
|
||||
final apiLocalizationData = <String, ScLocalizationData>{};
|
||||
for (var element in l) {
|
||||
@@ -123,6 +128,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
||||
apiLocalizationData[element.versionName ?? ""] = element;
|
||||
}
|
||||
}
|
||||
if (_isDisposed) return;
|
||||
state = state.copyWith(apiLocalizationData: apiLocalizationData);
|
||||
}
|
||||
final map = <String, ScLocalizationData>{};
|
||||
@@ -464,7 +470,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
||||
|
||||
dPrint(
|
||||
"_updateStatus updateStatus: $patchStatus , isInstalledAdvanced: $isInstalledAdvanced ,installedCommunityInputMethodSupportVersion: $installedCommunityInputMethodSupportVersion");
|
||||
|
||||
if (_isDisposed) return;
|
||||
state = state.copyWith(
|
||||
patchStatus: patchStatus,
|
||||
isInstalledAdvanced: isInstalledAdvanced,
|
||||
|
||||
@@ -42,7 +42,7 @@ final class LocalizationUIModelProvider
|
||||
}
|
||||
|
||||
String _$localizationUIModelHash() =>
|
||||
r'3d3f0ed7fa3631eca4e10d456c437f6fca8eedff';
|
||||
r'122f9f85da6e112165f4ff88667b45cf3cf3f43e';
|
||||
|
||||
abstract class _$LocalizationUIModel extends $Notifier<LocalizationUIState> {
|
||||
LocalizationUIState build();
|
||||
|
||||
Reference in New Issue
Block a user