Prefetch user (#429)

This commit is contained in:
Luke Vella 2023-01-23 14:19:17 +00:00 committed by GitHub
parent 37f777cace
commit 249376c43e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 220 additions and 181 deletions

View file

@ -17,7 +17,7 @@ import NameInput from "../name-input";
import TruncatedLinkify from "../poll/truncated-linkify";
import UserAvatar from "../poll/user-avatar";
import { usePoll } from "../poll-context";
import { isUnclaimed, useSession } from "../session";
import { isUnclaimed, useUser } from "../user-provider";
interface CommentForm {
authorName: string;
@ -68,7 +68,7 @@ const Discussion: React.VoidFunctionComponent = () => {
},
});
const session = useSession();
const session = useUser();
const { register, reset, control, handleSubmit, formState } =
useForm<CommentForm>({