@innspel/react-native 0.2.1 → 0.2.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.
package/dist/index.cjs CHANGED
@@ -1434,7 +1434,8 @@ function Widget({
1434
1434
  const [rotStorrelse, setRotStorrelse] = (0, import_react10.useState)({ width: 1, height: 1 });
1435
1435
  const [komponerer, setKomponerer] = (0, import_react10.useState)(false);
1436
1436
  const [vedlegg, setVedlegg] = (0, import_react10.useState)();
1437
- const skjermbildeMulig = client.settings.screenshotsEnabled && skjermbilde?.adapter != null;
1437
+ const [innstillinger, setInnstillinger] = (0, import_react10.useState)({ ...client.settings });
1438
+ const skjermbildeMulig = innstillinger.screenshotsEnabled && skjermbilde?.adapter != null;
1438
1439
  const nullstill = (0, import_react10.useCallback)(() => {
1439
1440
  setSteg("valg");
1440
1441
  setSpor("feil");
@@ -1458,6 +1459,7 @@ function Widget({
1458
1459
  if (!synlig) return;
1459
1460
  client.track({ name: "widget_opened" });
1460
1461
  void client.queue.flush().catch(() => void 0);
1462
+ void client.loadSettings().then((s) => setInnstillinger({ ...s })).catch(() => void 0);
1461
1463
  if (apneOpsjoner?.track) velgSpor(apneOpsjoner.track);
1462
1464
  }, [synlig]);
1463
1465
  const hentKort = (0, import_react10.useCallback)(async () => {
@@ -1660,8 +1662,8 @@ function Widget({
1660
1662
  spor,
1661
1663
  verdi,
1662
1664
  onEndre: endreTekst,
1663
- minTextLength: client.settings.minTextLength,
1664
- textMaxLength: client.settings.textMaxLength,
1665
+ minTextLength: innstillinger.minTextLength,
1666
+ textMaxLength: innstillinger.textMaxLength,
1665
1667
  kontekst: client.context,
1666
1668
  fjernedeFelter: fjernede,
1667
1669
  onFjernKontekst: (f) => setFjernede((x) => [...x, f]),