I think I have a working document cache solution that's actually pretty good.
This commit is contained in:
@@ -5,7 +5,7 @@ import type { CampaignId, Scene } from "@/lib/types";
|
||||
import { pb } from "@/lib/pocketbase";
|
||||
import { BaseForm } from "@/components/form/BaseForm";
|
||||
import { MultiLineInput } from "@/components/form/MultiLineInput";
|
||||
import { useDocument } from "@/context/document/DocumentContext";
|
||||
import { useDocumentCache } from "@/context/document/hooks";
|
||||
|
||||
/**
|
||||
* Renders a form to add a new scene. Calls onCreate with the new scene document.
|
||||
@@ -17,7 +17,7 @@ export const NewSceneForm = ({
|
||||
campaign: CampaignId;
|
||||
onCreate: (scene: Scene) => Promise<void>;
|
||||
}) => {
|
||||
const { dispatch } = useDocument();
|
||||
const { dispatch } = useDocumentCache();
|
||||
const [text, setText] = useState("");
|
||||
const [adding, setAdding] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
Reference in New Issue
Block a user