Profile does not retry
This commit is contained in:
parent
9cb34839ec
commit
386472e680
9
exam/dist/assets/index-4tvMRi1p.js
vendored
Normal file
9
exam/dist/assets/index-4tvMRi1p.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9
exam/dist/assets/index-CVjLtH9r.js
vendored
9
exam/dist/assets/index-CVjLtH9r.js
vendored
File diff suppressed because one or more lines are too long
2
exam/dist/index.html
vendored
2
exam/dist/index.html
vendored
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>GuestBook</title>
|
<title>GuestBook</title>
|
||||||
<script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-CVjLtH9r.js"></script>
|
<script type="module" crossorigin src="/phpCourse/exam/dist/assets/index-4tvMRi1p.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/react-C9_qfvjK.js">
|
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/react-C9_qfvjK.js">
|
||||||
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/mui-BnAUJOoN.js">
|
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/mui-BnAUJOoN.js">
|
||||||
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/tanstack-BqkrhB-y.js">
|
<link rel="modulepreload" crossorigin href="/phpCourse/exam/dist/assets/tanstack-BqkrhB-y.js">
|
||||||
|
|||||||
2
exam/dist/stats.html
vendored
2
exam/dist/stats.html
vendored
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "react",
|
"name": "react",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import {
|
|||||||
import { useForm } from '@tanstack/react-form';
|
import { useForm } from '@tanstack/react-form';
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { t } from 'i18next';
|
import { t } from 'i18next';
|
||||||
import { FC, FormEvent, useState } from 'react';
|
import { FC, FormEvent, useEffect, useState } from 'react';
|
||||||
import { useApi } from '../../../api/Api';
|
import { useApi } from '../../../api/Api';
|
||||||
import { PostAuth, PostUpdate } from '../../../types/Post';
|
import { PostAuth, PostUpdate } from '../../../types/Post';
|
||||||
import ErrorComponent from '../../Error/ErrorComponent';
|
import ErrorComponent from '../../Error/ErrorComponent';
|
||||||
@ -71,6 +71,10 @@ const PostEditDialog: FC<Props> = ({ post, open, onClose }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!Api.hasAuth) handleClose();
|
||||||
|
}, [Api.hasAuth]); //eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={open}
|
open={open}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import {
|
|||||||
import { useForm } from '@tanstack/react-form';
|
import { useForm } from '@tanstack/react-form';
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { t } from 'i18next';
|
import { t } from 'i18next';
|
||||||
import { FC, FormEvent, useState } from 'react';
|
import { FC, FormEvent, useEffect, useState } from 'react';
|
||||||
import { useApi } from '../../../api/Api';
|
import { useApi } from '../../../api/Api';
|
||||||
import { User, UserUpdate } from '../../../types/User';
|
import { User, UserUpdate } from '../../../types/User';
|
||||||
import ErrorComponent from '../../Error/ErrorComponent';
|
import ErrorComponent from '../../Error/ErrorComponent';
|
||||||
@ -71,6 +71,10 @@ const UserEditDialog: FC<Props> = ({ user, open, onClose }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!Api.hasAuth) handleClose();
|
||||||
|
}, [Api.hasAuth]); //eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={open}
|
open={open}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import {
|
|||||||
import { useForm } from '@tanstack/react-form';
|
import { useForm } from '@tanstack/react-form';
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { t } from 'i18next';
|
import { t } from 'i18next';
|
||||||
import { FC, FormEvent, useState } from 'react';
|
import { FC, FormEvent, useEffect, useState } from 'react';
|
||||||
import { useApi } from '../../../api/Api';
|
import { useApi } from '../../../api/Api';
|
||||||
import { User, UserImageUpdate } from '../../../types/User';
|
import { User, UserImageUpdate } from '../../../types/User';
|
||||||
import ErrorComponent from '../../Error/ErrorComponent';
|
import ErrorComponent from '../../Error/ErrorComponent';
|
||||||
@ -79,6 +79,10 @@ const UserImageDialog: FC<Props> = ({ user, open, onClose }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!Api.hasAuth) handleClose();
|
||||||
|
}, [Api.hasAuth]); //eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={open}
|
open={open}
|
||||||
|
|||||||
@ -8,10 +8,12 @@ export const profileSelfQueryOptions = (Api: ReturnType<typeof useApi>) =>
|
|||||||
user: await Api.user(),
|
user: await Api.user(),
|
||||||
posts: await Api.userPosts(Api.authenticatedUser?.id ?? 0),
|
posts: await Api.userPosts(Api.authenticatedUser?.id ?? 0),
|
||||||
}),
|
}),
|
||||||
|
retry: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const profileQueryOptions = (Api: ReturnType<typeof useApi>, id?: number) =>
|
export const profileQueryOptions = (Api: ReturnType<typeof useApi>, id?: number) =>
|
||||||
queryOptions({
|
queryOptions({
|
||||||
queryKey: ['profile', { id }],
|
queryKey: ['profile', { id }],
|
||||||
queryFn: async () => ({ user: await Api.user(id), posts: await Api.userPosts(id) }),
|
queryFn: async () => ({ user: await Api.user(id), posts: await Api.userPosts(id) }),
|
||||||
|
retry: false,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user