I think I have a working document cache solution that's actually pretty good.

This commit is contained in:
2025-07-03 16:24:58 -07:00
parent db4ce36c27
commit 503c98c895
26 changed files with 317 additions and 212 deletions

View File

@@ -1,6 +1,6 @@
// Displays a single secret with discovered checkbox and text.
import { AutoSaveTextarea } from "@/components/AutoSaveTextarea";
import { useDocument } from "@/context/document/DocumentContext";
import { useDocumentCache } from "@/context/document/hooks";
import { pb } from "@/lib/pocketbase";
import type { Secret } from "@/lib/types";
import { useState } from "react";
@@ -10,7 +10,7 @@ import { useState } from "react";
* Handles updating the discovered state and discoveredIn relationship.
*/
export const SecretEditForm = ({ secret }: { secret: Secret }) => {
const { dispatch } = useDocument();
const { dispatch } = useDocumentCache();
const [checked, setChecked] = useState(
!!(secret.data as any)?.secret?.discovered,
);