mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-29 11:15:51 +00:00
Fixed identity selection compose
This commit is contained in:
parent
40501d9941
commit
31f4445773
3 changed files with 6 additions and 5 deletions
|
@ -35,9 +35,10 @@ public interface DaoIdentity {
|
|||
|
||||
@Query("SELECT identity.* FROM identity" +
|
||||
" JOIN account ON account.id = identity.account" +
|
||||
" WHERE account.synchronize = :synchronize" +
|
||||
" WHERE (:account IS NULL OR account.id = :account)" +
|
||||
" AND account.synchronize = :synchronize" +
|
||||
" AND identity.synchronize = :synchronize")
|
||||
LiveData<List<EntityIdentity>> liveIdentities(boolean synchronize);
|
||||
LiveData<List<EntityIdentity>> liveIdentities(Long account, boolean synchronize);
|
||||
|
||||
@Query("SELECT * FROM identity")
|
||||
List<EntityIdentity> getIdentities();
|
||||
|
|
|
@ -1299,8 +1299,8 @@ public class FragmentCompose extends FragmentEx {
|
|||
|
||||
DB db = DB.getInstance(getContext());
|
||||
|
||||
db.identity().liveIdentities(true).removeObservers(getViewLifecycleOwner());
|
||||
db.identity().liveIdentities(true).observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
|
||||
db.identity().liveIdentities(result.draft.account, true).removeObservers(getViewLifecycleOwner());
|
||||
db.identity().liveIdentities(result.draft.account, true).observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
|
||||
@Override
|
||||
public void onChanged(@Nullable List<EntityIdentity> identities) {
|
||||
if (identities == null)
|
||||
|
|
|
@ -354,7 +354,7 @@ public class FragmentSetup extends FragmentEx {
|
|||
}
|
||||
});
|
||||
|
||||
db.identity().liveIdentities(true).observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
|
||||
db.identity().liveIdentities(null, true).observe(getViewLifecycleOwner(), new Observer<List<EntityIdentity>>() {
|
||||
@Override
|
||||
public void onChanged(@Nullable List<EntityIdentity> identities) {
|
||||
boolean done = (identities != null && identities.size() > 0);
|
||||
|
|
Loading…
Reference in a new issue