mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
changed uploader to fetch hidden files
This commit is contained in:
parent
20bb0ec13b
commit
1aff4d5b73
8 changed files with 51 additions and 34 deletions
|
@ -9,8 +9,8 @@ export interface IUploadStatus {
|
|||
preview: string;
|
||||
uuid: UUID;
|
||||
url: string;
|
||||
thumbnail_url: string;
|
||||
type: string;
|
||||
thumbnail_url: string;
|
||||
progress: number;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ function* uploadCall({ temp_id, onProgress, file }) {
|
|||
return yield call(reqWrapper, fakeUploader, { file: { url: 'some', error: 'cant do this boss' }, onProgress, mustSucceed: true });
|
||||
}
|
||||
|
||||
function* onUploadProgress(chan) {
|
||||
function* onUploadProgress(chan) {
|
||||
while (true) {
|
||||
const { progress, temp_id }: { progress: number; temp_id: string } = yield take(chan);
|
||||
|
||||
|
@ -85,6 +85,7 @@ function* uploadFile({ file, temp_id }: IFileWithUUID) {
|
|||
uuid: data.id,
|
||||
url: data.full_path,
|
||||
thumbnail_url: data.full_path,
|
||||
progress: 1,
|
||||
})
|
||||
);
|
||||
|
||||
|
|
5
src/redux/uploads/selectors.ts
Normal file
5
src/redux/uploads/selectors.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { IState } from '~/redux/store';
|
||||
import { IUploadState } from '~/redux/uploads/reducer';
|
||||
|
||||
export const selectUploads = ({ uploads }: IState): IUploadState => uploads;
|
||||
export const selectUploadStatuses = ({ uploads: { statuses } }: IState): IUploadState['statuses'] => statuses;
|
Loading…
Add table
Add a link
Reference in a new issue