Skip to content

Commit

Permalink
Remove scan dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Jul 21, 2023
1 parent a060102 commit efb2cc5
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/Store/Upload/UploadSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
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
*/
Expand Down Expand Up @@ -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())
},
)

Expand Down

0 comments on commit efb2cc5

Please sign in to comment.