mirror of
https://github.com/videolan/vlc-android
synced 2024-12-03 23:06:21 +08:00
OpenSubtitles: prevent re-sending invalid credentials
This commit is contained in:
parent
f9550f9ec9
commit
ba2d715222
@ -57,6 +57,8 @@ class SubtitleDownloaderDialogFragment : VLCBottomSheetDialogFragment() {
|
|||||||
private lateinit var names: String
|
private lateinit var names: String
|
||||||
private lateinit var viewModel: SubtitlesModel
|
private lateinit var viewModel: SubtitlesModel
|
||||||
private lateinit var toast: Toast
|
private lateinit var toast: Toast
|
||||||
|
private var lastUsername: String = ""
|
||||||
|
private var lastPassword: String = ""
|
||||||
|
|
||||||
private var state: SubDownloadDialogState = SubDownloadDialogState.Download
|
private var state: SubDownloadDialogState = SubDownloadDialogState.Download
|
||||||
set(value) {
|
set(value) {
|
||||||
@ -142,7 +144,12 @@ class SubtitleDownloaderDialogFragment : VLCBottomSheetDialogFragment() {
|
|||||||
binding.loginButton.setOnClickListener {
|
binding.loginButton.setOnClickListener {
|
||||||
if (viewModel.observableUser.get()?.logged == true) {
|
if (viewModel.observableUser.get()?.logged == true) {
|
||||||
viewModel.logout(settings)
|
viewModel.logout(settings)
|
||||||
}else {
|
} else {
|
||||||
|
if (lastPassword == binding.password.text.toString() && lastUsername == binding.username.text.toString()) {
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
lastPassword = binding.password.text.toString()
|
||||||
|
lastUsername = binding.username.text.toString()
|
||||||
viewModel.login(
|
viewModel.login(
|
||||||
settings,
|
settings,
|
||||||
binding.username.text.toString(),
|
binding.username.text.toString(),
|
||||||
|
Loading…
Reference in New Issue
Block a user