Skip to content

Commit 5367b66

Browse files
authored
Update purchase widget (#149)
1 parent b50eb13 commit 5367b66

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file.
77
### Removed
88
### Fixed
99

10+
## [0.71.1]
11+
### Fixed
12+
* ui-toolkit: Wrong behaviour of the purchase widget (#149)
13+
1014
## [0.71.0]
1115
### Changed
1216
* Dependency updates and remove obsolete samples (#141)

ui-toolkit/src/main/kotlin/io/snabble/sdk/widgets/snabble/purchase/repository/PurchasesRepository.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ internal class PurchasesRepositoryImpl(
4242
}
4343

4444
private fun Array<ReceiptInfo>?.mapToPurchases(count: Int): List<Purchase> {
45-
val receiptInfoList = this?.toList() ?: emptyList()
45+
val receiptInfoList = this?.toList()?.filter { it.pdfUrl != null } ?: emptyList()
46+
if (receiptInfoList.isEmpty()) return emptyList()
4647
return receiptInfoList
4748
.slice(0 until receiptInfoList.size.coerceAtMost(count))
4849
.map { it.toPurchase(timeFormatter) }

0 commit comments

Comments
 (0)