rampkit-expo-dev 0.0.34 → 0.0.35
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/build/RampkitOverlay.js +6 -9
- package/package.json +1 -1
package/build/RampkitOverlay.js
CHANGED
|
@@ -777,16 +777,14 @@ function Overlay(props) {
|
|
|
777
777
|
if (__DEV__)
|
|
778
778
|
console.log("[Rampkit] received variables from page", i, data.vars);
|
|
779
779
|
// Check if this page is within the stale value window
|
|
780
|
-
// (we recently sent vars to it and it
|
|
780
|
+
// (we recently sent vars to it and it may be echoing back defaults)
|
|
781
781
|
const now = Date.now();
|
|
782
782
|
const lastSendTime = lastVarsSendTimeRef.current[i] || 0;
|
|
783
783
|
const timeSinceSend = now - lastSendTime;
|
|
784
784
|
const isWithinStaleWindow = timeSinceSend < STALE_VALUE_WINDOW_MS;
|
|
785
|
-
const isActiveScreen = i === index;
|
|
786
785
|
if (__DEV__) {
|
|
787
786
|
console.log("[Rampkit] stale check:", {
|
|
788
787
|
pageIndex: i,
|
|
789
|
-
isActiveScreen,
|
|
790
788
|
isWithinStaleWindow,
|
|
791
789
|
timeSinceSend,
|
|
792
790
|
});
|
|
@@ -797,12 +795,11 @@ function Overlay(props) {
|
|
|
797
795
|
const hasHostVal = Object.prototype.hasOwnProperty.call(varsRef.current, key);
|
|
798
796
|
const hostVal = varsRef.current[key];
|
|
799
797
|
// Stale value filtering (matches iOS SDK behavior):
|
|
800
|
-
// If we're within the stale window
|
|
801
|
-
//
|
|
802
|
-
// This prevents
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
// keep the host value (don't overwrite with stale data)
|
|
798
|
+
// If we're within the stale window, don't let empty/default values
|
|
799
|
+
// overwrite existing non-empty host values.
|
|
800
|
+
// This prevents pages from clobbering user input with cached defaults
|
|
801
|
+
// when they first become active/visible.
|
|
802
|
+
if (isWithinStaleWindow && hasHostVal) {
|
|
806
803
|
const hostIsNonEmpty = hostVal !== "" && hostVal !== null && hostVal !== undefined;
|
|
807
804
|
const incomingIsEmpty = value === "" || value === null || value === undefined;
|
|
808
805
|
if (hostIsNonEmpty && incomingIsEmpty) {
|
package/package.json
CHANGED