From efb2cc552c54a226a7ad7b5e93917c15952833d3 Mon Sep 17 00:00:00 2001 From: derneuere Date: Fri, 21 Jul 2023 13:34:52 +0200 Subject: [PATCH] Remove scan dispatch --- src/Store/Upload/UploadSlice.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/Store/Upload/UploadSlice.ts b/src/Store/Upload/UploadSlice.ts index 5621237..50232c5 100644 --- a/src/Store/Upload/UploadSlice.ts +++ b/src/Store/Upload/UploadSlice.ts @@ -19,25 +19,6 @@ const initialState: UploadState = { isUploading: false, } -/** - * Dispatches a scan photos action to the server and sets worker availability - * @returns a function that dispatches actions to the redux store - */ -export function scanUploadedPhotos() { - return function (dispatch: Dispatch) { - dispatch({ type: 'SCAN_PHOTOS' }) - dispatch({ type: 'SET_WORKER_AVAILABILITY', payload: false }) - - Server.get('scanuploadedphotos/') - .then(response => { - dispatch({ type: 'SCAN_PHOTOS_FULFILLED', payload: response.data }) - }) - .catch(err => { - dispatch({ type: 'SCAN_PHOTOS_REJECTED', payload: err }) - }) - } -} - /** * The upload slice, containing reducers and extra reducers */ @@ -316,8 +297,6 @@ export const uploadImages = createAsyncThunk( dispatch(localImageSynced(file)) } } - // To-Do: dispatch an update for the image, that it is now uploaded - dispatch(scanUploadedPhotos()) }, )