disable cache for fetch inputimage
This commit is contained in:
parent
705e12d02d
commit
a6f29be662
@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react'
|
||||
import { useToggle, useWindowSize } from 'react-use'
|
||||
import Button from './components/Button'
|
||||
import FileSelect from './components/FileSelect'
|
||||
import useInputImage from './components/hooks/useInputImage'
|
||||
import useInputImage from './hooks/useInputImage'
|
||||
import ShortcutsModal from './components/ShortcutsModal'
|
||||
import Editor from './Editor'
|
||||
|
||||
|
@ -4,7 +4,11 @@ export default function useInputImage() {
|
||||
const [inputImage, setInputImage] = useState<File>()
|
||||
|
||||
const fetchInputImage = useCallback(() => {
|
||||
fetch('/inputimage')
|
||||
const headers = new Headers()
|
||||
headers.append('pragma', 'no-cache')
|
||||
headers.append('cache-control', 'no-cache')
|
||||
|
||||
fetch('/inputimage', { headers })
|
||||
.then(res => res.blob())
|
||||
.then(data => {
|
||||
if (data && data.type.startsWith('image')) {
|
Loading…
Reference in New Issue
Block a user