mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Call loadOwnIdentityInfo() in SettingsViewModel's constructor
This commit is contained in:
committed by
Torsten Grote
parent
97040c6299
commit
1a5e789bec
@@ -62,7 +62,6 @@ public class ConfirmAvatarDialogFragment extends DialogFragment {
|
||||
ViewModelProvider provider =
|
||||
new ViewModelProvider(activity, viewModelFactory);
|
||||
settingsViewModel = provider.get(SettingsViewModel.class);
|
||||
settingsViewModel.onCreate();
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ public class SettingsActivity extends BriarActivity {
|
||||
ViewModelProvider provider =
|
||||
new ViewModelProvider(this, viewModelFactory);
|
||||
settingsViewModel = provider.get(SettingsViewModel.class);
|
||||
settingsViewModel.onCreate();
|
||||
|
||||
settingsViewModel.getOwnIdentityInfo().observe(this, us -> {
|
||||
TextView textViewUserName = findViewById(R.id.username);
|
||||
|
||||
@@ -61,10 +61,8 @@ class SettingsViewModel extends AndroidViewModel {
|
||||
this.avatarManager = avatarManager;
|
||||
this.authorManager = authorManager;
|
||||
this.dbExecutor = dbExecutor;
|
||||
}
|
||||
|
||||
void onCreate() {
|
||||
if (ownIdentityInfo.getValue() == null) loadOwnIdentityInfo();
|
||||
loadOwnIdentityInfo();
|
||||
}
|
||||
|
||||
LiveData<OwnIdentityInfo> getOwnIdentityInfo() {
|
||||
|
||||
Reference in New Issue
Block a user