mirror of
https://github.com/Steffo99/festa.git
synced 2025-01-09 07:19:43 +00:00
Disable revalidation while editing
This commit is contained in:
parent
486050587f
commit
ff73ab681f
1 changed files with 2 additions and 2 deletions
|
@ -42,9 +42,9 @@ const PageEvent: NextPage<PageEventProps> = ({ slug, fallbackData }) => {
|
|||
const { t } = useTranslation()
|
||||
const axios = useAxios()
|
||||
|
||||
const { data, mutate } = useSWR<Event>(`/api/events/${slug}`, { fallbackData })
|
||||
const [auth,] = useDefinedContext(AuthContext)
|
||||
const [eventEditing, eventSetEditing] = useState<boolean>(false)
|
||||
const { data, mutate } = useSWR<Event>(`/api/events/${slug}`, { fallbackData, revalidateOnFocus: eventEditing, revalidateOnReconnect: eventEditing, refreshInterval: eventEditing ? 0 : 30000 })
|
||||
const [auth,] = useDefinedContext(AuthContext)
|
||||
|
||||
const save = useCallback(
|
||||
async () => {
|
||||
|
|
Loading…
Reference in a new issue