|
|
|
@ -17,13 +17,16 @@ const files = []
|
|
|
|
|
const MAX_FILE_COUNT = 3
|
|
|
|
|
const MAX_FILE_SIZE = 200
|
|
|
|
|
let noUploads = true
|
|
|
|
|
|
|
|
|
|
function VideoUploadList (props) {
|
|
|
|
|
|
|
|
|
|
// const [videos, setvideos] = useState([]);
|
|
|
|
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
|
|
|
const theme = useContext(ThemeContext)
|
|
|
|
|
const [couldRouteNav, setCouldRouteNav] = useState(false)
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setCouldRouteNav(false);
|
|
|
|
|
// Chrome removed support for custom message in ver 51
|
|
|
|
|
// https://stackoverflow.com/questions/38879742/is-it-possible-to-display-a-custom-message-in-the-beforeunload-popup
|
|
|
|
|
window.addEventListener("beforeunload", beforeunload);
|
|
|
|
@ -220,6 +223,8 @@ function VideoUploadList (props) {
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
// to success page
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
dispatch({type: 'removeAll'})
|
|
|
|
|
// setCouldRouteNav(true)
|
|
|
|
|
history.push(`/users/${username}/videos/success`)
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|