@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 { onMount } from "svelte";
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 mounts, select it
31
- // This handles tab switches where a new default package appears
32
- onMount(() => {
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
- $selectedPackageId = package_id;
37
+ const newPackageId = package_id;
38
+ untrack(() => {
39
+ $selectedPackageId = newPackageId;
40
+ });
35
41
  }
36
42
  });
37
43
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@revenuecat/purchases-ui-js",
3
3
  "description": "Web components for Paywalls. Powered by RevenueCat",
4
4
  "private": false,
5
- "version": "4.7.1",
5
+ "version": "4.7.2",
6
6
  "author": {
7
7
  "name": "RevenueCat, Inc."
8
8
  },