mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Merge pull request #10013 from nextcloud/fix/login-after-logout
Fix bugs when removing accounts
This commit is contained in:
commit
d9811e1f34
2 changed files with 15 additions and 5 deletions
|
@ -58,7 +58,6 @@ import com.owncloud.android.utils.FileStorageUtils
|
|||
import com.owncloud.android.utils.PushUtils
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import java.io.File
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* Removes account and all local files
|
||||
|
@ -150,6 +149,9 @@ class AccountRemovalWork(
|
|||
deleteAppPasswordRemoteOperation.execute(optionNextcloudClient.get())
|
||||
}
|
||||
|
||||
// delete cached OwncloudClient
|
||||
OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(user.toOwnCloudAccount())
|
||||
|
||||
if (userRemoved) {
|
||||
eventBus.post(AccountRemovedEvent())
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ import com.nextcloud.client.onboarding.FirstRunActivity;
|
|||
import com.nextcloud.java.util.Optional;
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AuthenticatorActivity;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.files.services.FileDownloader;
|
||||
|
@ -180,11 +181,18 @@ public class ManageAccountsActivity extends FileActivity implements UserListAdap
|
|||
@Override
|
||||
public void onBackPressed() {
|
||||
Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra(KEY_ACCOUNT_LIST_CHANGED, hasAccountListChanged());
|
||||
resultIntent.putExtra(KEY_CURRENT_ACCOUNT_CHANGED, hasCurrentAccountChanged());
|
||||
setResult(RESULT_OK, resultIntent);
|
||||
if (accountManager.getAllUsers().size() > 0) {
|
||||
resultIntent.putExtra(KEY_ACCOUNT_LIST_CHANGED, hasAccountListChanged());
|
||||
resultIntent.putExtra(KEY_CURRENT_ACCOUNT_CHANGED, hasCurrentAccountChanged());
|
||||
setResult(RESULT_OK, resultIntent);
|
||||
|
||||
super.onBackPressed();
|
||||
super.onBackPressed();
|
||||
} else {
|
||||
final Intent intent = new Intent(this, AuthenticatorActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue