mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 08:55:54 +03:00
Exit the app when there is only this EOL account
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
1f8905394e
commit
c789152122
2 changed files with 11 additions and 1 deletions
|
@ -301,7 +301,12 @@ public class ConversationsListController extends BaseController implements Searc
|
|||
.setNegativeButton(R.string.nc_cancel, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (userUtils.hasMultipleUsers()) {
|
||||
getRouter().pushController(RouterTransaction.with(new SwitchAccountController()));
|
||||
} else {
|
||||
getActivity().finishAffinity();
|
||||
getActivity().finish();
|
||||
}
|
||||
}
|
||||
})
|
||||
.setInstanceStateHandler(ID_DELETE_CONVERSATION_DIALOG, saveStateHandler)
|
||||
|
|
|
@ -48,6 +48,11 @@ public class UserUtils {
|
|||
.limit(1).get().value() > 0);
|
||||
}
|
||||
|
||||
public boolean hasMultipleUsers() {
|
||||
return (dataStore.count(User.class).where(UserEntity.SCHEDULED_FOR_DELETION.notEqual(Boolean.TRUE))
|
||||
.get().value() > 1);
|
||||
}
|
||||
|
||||
public List getUsers() {
|
||||
Result findUsersQueryResult = dataStore.select(User.class).where
|
||||
(UserEntity.SCHEDULED_FOR_DELETION.notEqual(true)).get();
|
||||
|
|
Loading…
Reference in a new issue