@sanity/studio-secrets
4.0.214.0.22
dist/index.js~
dist/index.jsModified+2−2
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1,9 +1,9 @@
import "@sanity/ui/styles.css";
import { c } from "react/compiler-runtime";
import { Button, Card, Dialog, Stack, Text, TextInput } from "@sanity/ui";
import { useEffect, useState } from "react";
-import { useObservable } from "react-rx";
+import { useSyncObservable } from "react-rx";
import { map } from "rxjs";
import { useClient, useDocumentPreviewStore } from "sanity";
import { jsx, jsxs } from "react/jsx-runtime";
const INITIAL_STATE = {
@@ -14,9 +14,9 @@
let $ = c(11), [saving, setSaving] = useState(!1), t0;
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { apiVersion: "2021-03-01" }, $[0] = t0) : t0 = $[0];
let client = useClient(t0), documentPreviewStore = useDocumentPreviewStore(), id = `secrets.${namespace}`, t1;
$[1] !== documentPreviewStore || $[2] !== id ? (t1 = documentPreviewStore.unstable_observeDocument(id).pipe(map(_temp)), $[1] = documentPreviewStore, $[2] = id, $[3] = t1) : t1 = $[3];
- let { loading: readLoading, secrets } = useObservable(t1, INITIAL_STATE), t2;
+ let { loading: readLoading, secrets } = useSyncObservable(t1, INITIAL_STATE), t2;
$[4] !== client || $[5] !== id ? (t2 = (updatedSecret) => {
setSaving(!0);
let keysPatch = client.patch(id).set({ secrets: updatedSecret });
client.transaction().createIfNotExists({