From 0e0d553c0b264df77d742e15f3fb666a46d2adaa Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 14 May 2020 22:17:43 +0200 Subject: [PATCH] Fixed filtering chipTAN USB (as e.g. "Smart-TAN plus optisch / USB" should be displayed of course --- .../banking/fints4java/android/ui/dialogs/EnterTanDialog.kt | 4 ++-- .../dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt index 11bdb30f..e7225f91 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/dialogs/EnterTanDialog.kt @@ -91,14 +91,14 @@ open class EnterTanDialog : DialogFragment() { protected open fun setupSelectTanProcedureView(rootView: View) { val adapter = TanProceduresAdapter() - val tanProceduresWithoutUnsupported = account.supportedTanProcedures.filterNot { it.displayName.contains("usb", true) } // USB tan generators are not supported on Android + val tanProceduresWithoutUnsupported = account.supportedTanProcedures.filterNot { it.type == TanProcedureType.ChipTanUsb } // USB tan generators are not supported on Android adapter.setItems(tanProceduresWithoutUnsupported) rootView.findViewById(R.id.spnTanProcedures)?.let { spinner -> spinner.adapter = adapter val selectedTanProcedure = account.selectedTanProcedure - ?: tanProceduresWithoutUnsupported.filter { it.displayName.contains("manuell") == false && it.displayName.contains("usb") == false }.firstOrNull() + ?: tanProceduresWithoutUnsupported.firstOrNull { it.type != TanProcedureType.ChipTanManuell && it.type != TanProcedureType.ChipTanUsb } ?: tanProceduresWithoutUnsupported.firstOrNull() selectedTanProcedure?.let { spinner.setSelection(adapter.getItems().indexOf(selectedTanProcedure)) } diff --git a/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt b/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt index 4786fde6..1d8a4c3c 100644 --- a/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt +++ b/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/tan/EnterTanDialog.kt @@ -31,7 +31,7 @@ open class EnterTanDialog( protected val dialogService = JavaFxDialogService() - protected val tanProceduresWithoutUnsupported = account.supportedTanProcedures.filterNot { it.displayName.contains("usb", true) } // USB tan generators are not supported + protected val tanProceduresWithoutUnsupported = account.supportedTanProcedures.filterNot { it.type == TanProcedureType.ChipTanUsb } // USB tan generators are not supported protected val selectedTanProcedure = SimpleObjectProperty(account.selectedTanProcedure ?: tanProceduresWithoutUnsupported.firstOrNull { it.displayName.contains("manuell", true) == false } ?: tanProceduresWithoutUnsupported.firstOrNull())