1
0
Fork 0
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:
muerwre 2019-08-07 17:44:00 +07:00
parent 20bb0ec13b
commit 1aff4d5b73
8 changed files with 51 additions and 34 deletions

View file

@ -9,8 +9,8 @@ export interface IUploadStatus {
preview: string;
uuid: UUID;
url: string;
thumbnail_url: string;
type: string;
thumbnail_url: string;
progress: number;
}

View file

@ -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,
})
);

View 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;