@revenuecat/purchases-ui-js 4.8.18 → 4.8.19
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.
|
@@ -305,6 +305,13 @@
|
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
+
// Merge this component's own `customVariables` prop with the dashboard
|
|
309
|
+
// defaults. On the standalone path, this is the only source of custom
|
|
310
|
+
// variable values. On the workflow path, the host has already merged its
|
|
311
|
+
// `customVariables` into `globalVariables` — that merge must win here, or
|
|
312
|
+
// this component's defaults-only merge (since `customVariables` is never
|
|
313
|
+
// passed down by the workflow) silently overwrites the host's overrides
|
|
314
|
+
// for any variable that also has a declared dashboard default.
|
|
308
315
|
const mergedCustomVars = mergeCustomVariables(customVariables, uiConfig);
|
|
309
316
|
|
|
310
317
|
setPaywallContext({
|
|
@@ -312,8 +319,8 @@
|
|
|
312
319
|
selectedPackageId,
|
|
313
320
|
variablesPerPackage: readable(variablesPerPackage),
|
|
314
321
|
baseVariables: readable({
|
|
315
|
-
...globalVariables,
|
|
316
322
|
...mergedCustomVars,
|
|
323
|
+
...globalVariables,
|
|
317
324
|
}),
|
|
318
325
|
infoPerPackage: readable(infoPerPackage),
|
|
319
326
|
onPurchase,
|
|
@@ -341,8 +348,8 @@
|
|
|
341
348
|
const variables: VariablesStore = derived(selectedPackageId, (packageId) => {
|
|
342
349
|
const packageVars = variablesPerPackage[packageId || ""];
|
|
343
350
|
return {
|
|
344
|
-
...globalVariables,
|
|
345
351
|
...mergedCustomVars,
|
|
352
|
+
...globalVariables,
|
|
346
353
|
...packageVars,
|
|
347
354
|
};
|
|
348
355
|
});
|