Skip to content

Commit 8a2a570

Browse files
committed
only update prices when the shop actually changes
1 parent c050b46 commit 8a2a570

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

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

4+
## [0.42.1]
5+
6+
### Fixed
7+
- Only update prices when the shop differs, not always when setCheckedInShop is called
8+
49
## [0.42.0]
510

611
### Changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212

1313
dependencies {
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15-
classpath 'com.android.tools.build:gradle:7.0.0'
15+
classpath 'com.android.tools.build:gradle:4.2.2'
1616
classpath 'gradle.plugin.com.github.jlouns:gradle-cross-platform-exec-plugin:0.5.0'
1717
classpath "gradle.plugin.gmazzo:sqlite-plugin:0.2"
1818
}
@@ -31,7 +31,7 @@ allprojects {
3131
}
3232

3333
project.ext {
34-
sdkVersion='0.42.0'
34+
sdkVersion='0.42.1'
3535
versionCode=1
3636

3737
compileSdkVersion=30

core/src/main/java/io/snabble/sdk/Project.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,11 @@ public String getText(String key, String defaultValue) {
483483
* payment process.
484484
*/
485485
public void setCheckedInShop(Shop checkedInShop) {
486-
this.checkedInShop = checkedInShop;
487-
events.updateShop(checkedInShop);
488-
getShoppingCart().updatePrices(false);
486+
if (this.checkedInShop == null || !this.checkedInShop.getId().equals(checkedInShop.getId())) {
487+
this.checkedInShop = checkedInShop;
488+
events.updateShop(checkedInShop);
489+
getShoppingCart().updatePrices(false);
490+
}
489491
}
490492

491493
public Shop getCheckedInShop() {

0 commit comments

Comments
 (0)