@revenuecat/purchases-ui-js 4.7.1 → 4.7.2
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
setVariablesContext,
|
|
8
8
|
} from "../../stores/variables";
|
|
9
9
|
import type { PackageProps } from "../../types/components/package";
|
|
10
|
-
import {
|
|
10
|
+
import { untrack } from "svelte";
|
|
11
11
|
import { writable } from "svelte/store";
|
|
12
12
|
import {
|
|
13
13
|
getPackageInfoContext,
|
|
@@ -27,11 +27,17 @@
|
|
|
27
27
|
infoPerPackage,
|
|
28
28
|
} = getPaywallContext();
|
|
29
29
|
|
|
30
|
-
// When a package with is_selected_by_default
|
|
31
|
-
// This handles tab switches where a new default package
|
|
32
|
-
|
|
30
|
+
// When a package with is_selected_by_default appears, select it.
|
|
31
|
+
// This handles tab switches where a new default package is shown.
|
|
32
|
+
// selectedPackageId is deliberately not tracked so that manually
|
|
33
|
+
// selecting another package does not re-trigger this effect and
|
|
34
|
+
// snap selection back to the default.
|
|
35
|
+
$effect(() => {
|
|
33
36
|
if (is_selected_by_default) {
|
|
34
|
-
|
|
37
|
+
const newPackageId = package_id;
|
|
38
|
+
untrack(() => {
|
|
39
|
+
$selectedPackageId = newPackageId;
|
|
40
|
+
});
|
|
35
41
|
}
|
|
36
42
|
});
|
|
37
43
|
|