@momo-kits/native-kits 0.160.1-scrolltotop.11-debug → 0.160.1-scrolltotop.12-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.160.1-scrolltotop.11-debug"
43
+ version = "0.160.1-scrolltotop.12-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -53,8 +53,14 @@ object ScrollToTopRegistry {
53
53
 
54
54
  internal fun push(owner: Any, token: Any, callback: () -> Unit) {
55
55
  val stack = stacksByOwner.getOrPut(owner) { mutableListOf() }
56
- stack.removeAll { it.token === token }
57
- stack.add(Entry(token, callback))
56
+ val idx = stack.indexOfFirst { it.token === token }
57
+ if (idx >= 0) {
58
+ // Same screen, callback changed (e.g. via setOptions) — replace in place
59
+ // so we don't reorder the per-owner stack.
60
+ stack[idx] = Entry(token, callback)
61
+ } else {
62
+ stack.add(Entry(token, callback))
63
+ }
58
64
  }
59
65
 
60
66
  internal fun remove(owner: Any, token: Any) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.160.1-scrolltotop.11-debug",
3
+ "version": "0.160.1-scrolltotop.12-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},