@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.
package/compose/build.gradle.kts
CHANGED
|
@@ -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.
|
|
57
|
-
|
|
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) {
|