mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-02 16:09:08 +02:00
🐛 Fix client error being thrown (#725)
This commit is contained in:
parent
267a40768a
commit
e43864e6a9
6 changed files with 16 additions and 5 deletions
|
@ -40,7 +40,7 @@
|
|||
"color-hash": "^2.0.2",
|
||||
"crypto": "^1.0.1",
|
||||
"dayjs": "^1.11.8",
|
||||
"framer-motion": "^6.5.1",
|
||||
"framer-motion": "^10.12.18",
|
||||
"i18next": "^22.4.9",
|
||||
"i18next-icu": "^2.3.0",
|
||||
"ics": "^3.1.0",
|
||||
|
|
|
@ -277,7 +277,7 @@ const Prefetch = ({ children }: React.PropsWithChildren) => {
|
|||
return <Error404 />;
|
||||
}
|
||||
|
||||
if (!poll.isFetched || !watchers.isFetched || !participants.isFetched) {
|
||||
if (!poll.data || !watchers.data || !participants.data) {
|
||||
return (
|
||||
<div>
|
||||
<TopBar className="flex flex-col items-start justify-between gap-y-2 gap-x-4 sm:flex-row">
|
||||
|
|
|
@ -243,7 +243,7 @@ const PollOption: React.FunctionComponent<PollOptionProps> = ({
|
|||
/>
|
||||
</div>
|
||||
) : (
|
||||
<AnimatePresence initial={false} exitBeforeEnter={true}>
|
||||
<AnimatePresence initial={false} mode="wait">
|
||||
<PopInOut
|
||||
key={vote}
|
||||
className="flex h-full w-9 items-center justify-center"
|
||||
|
|
|
@ -55,7 +55,7 @@ export const ScoreSummary: React.FunctionComponent<PopularityScoreProps> =
|
|||
}}
|
||||
>
|
||||
<User2Icon className="h-3 w-3" />
|
||||
<AnimatePresence initial={false} exitBeforeEnter={true}>
|
||||
<AnimatePresence initial={false} mode="wait">
|
||||
<m.span
|
||||
transition={{
|
||||
duration: 0.1,
|
||||
|
|
|
@ -22,6 +22,8 @@ export const Page = () => {
|
|||
const router = useRouter();
|
||||
const { token } = router.query;
|
||||
const posthog = usePostHog();
|
||||
const queryClient = trpc.useContext();
|
||||
|
||||
const authenticate = trpc.whoami.authenticate.useMutation();
|
||||
|
||||
useMount(() => {
|
||||
|
@ -33,7 +35,7 @@ export const Page = () => {
|
|||
name: user.name,
|
||||
email: user.email,
|
||||
});
|
||||
|
||||
queryClient.invalidate();
|
||||
setTimeout(() => {
|
||||
router.replace(defaultRedirectPath);
|
||||
}, 1000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue