mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 15:03:37 +00:00
Reset server preferences on login error
This commit is contained in:
@@ -93,6 +93,7 @@ public class ServerAdapter extends RecyclerView.Adapter<ServerAdapter.ViewHolder
|
||||
systemRepository.checkUserCredential(new SystemCallback() {
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
resetServerPreference();
|
||||
Toast.makeText(context, exception.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@@ -128,5 +129,15 @@ public class ServerAdapter extends RecyclerView.Adapter<ServerAdapter.ViewHolder
|
||||
|
||||
App.getSubsonicClientInstance(context, true);
|
||||
}
|
||||
|
||||
private void resetServerPreference() {
|
||||
PreferenceUtil.getInstance(context).setServerId(null);
|
||||
PreferenceUtil.getInstance(context).setServer(null);
|
||||
PreferenceUtil.getInstance(context).setUser(null);
|
||||
PreferenceUtil.getInstance(context).setPassword(null);
|
||||
PreferenceUtil.getInstance(context).setLowSecurity(false);
|
||||
|
||||
App.getSubsonicClientInstance(context, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user