Skip to content

Commit d4aa424

Browse files
committed
fix sku lookups when using imeActionDone
1 parent bee30d1 commit d4aa424

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.38.1]
5+
6+
### Updated
7+
- Updated Datatrans SDK to v1.4.0
8+
9+
### Fixed
10+
- Product searches of sku's are now also working on pressing the imeActionDone.
11+
412
## [0.38.0]
513

614
### Added

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ allprojects {
3131
}
3232

3333
project.ext {
34-
sdkVersion='0.38.0'
34+
sdkVersion='0.38.1'
3535
versionCode=1
3636

3737
compileSdkVersion=30

ui/src/main/java/io/snabble/sdk/ui/scanner/ProductResolver.kt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,21 @@ class ProductResolver private constructor(private val context: Context, private
143143
if (gs1GtinScannedCodes.isNotEmpty() && gs1Code == null) {
144144
lookupProductData(gs1GtinScannedCodes, newGs1Code)
145145
} else {
146-
project.events.productNotFound(scannedCodes)
147-
handleProductNotFound(result.code!!)
146+
project.productDatabase.findBySkuOnline(scannedCodes[0].lookupCode, object : OnProductAvailableListener {
147+
override fun onProductAvailable(product: Product, wasOnline: Boolean) {
148+
handleProductAvailable(product, wasOnline, scannedCodes[0], null)
149+
}
150+
151+
override fun onProductNotFound() {
152+
project.events.productNotFound(scannedCodes)
153+
handleProductNotFound(scannedCodes[0])
154+
}
155+
156+
override fun onError() {
157+
handleProductError()
158+
}
159+
})
160+
148161
}
149162
}
150163
}

0 commit comments

Comments
 (0)