mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 06:31:58 +00:00
improve web
This commit is contained in:
parent
95adc02fcb
commit
a9d0be43f5
2 changed files with 5 additions and 7 deletions
|
@ -11,7 +11,6 @@ import {
|
|||
} from '@api';
|
||||
import { handleError } from './handle-error';
|
||||
import { DateTime } from 'luxon';
|
||||
import type { AxiosProgressEvent } from 'axios';
|
||||
|
||||
export const addAssetsToAlbum = async (albumId: string, assetIds: Array<string>): Promise<BulkIdResponseDto[]> =>
|
||||
api.albumApi
|
||||
|
@ -126,8 +125,8 @@ export const downloadFile = async (asset: AssetResponseDto) => {
|
|||
{ id, key: api.getKey() },
|
||||
{
|
||||
responseType: 'blob',
|
||||
onDownloadProgress: (event: AxiosProgressEvent) => {
|
||||
if (event.total !== undefined) {
|
||||
onDownloadProgress: ({ event }) => {
|
||||
if (event.lengthComputable) {
|
||||
downloadManager.update(downloadKey, event.loaded, event.total);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -83,10 +83,9 @@ async function fileUploader(asset: File, albumId: string | undefined = undefined
|
|||
key: api.getKey(),
|
||||
},
|
||||
{
|
||||
onUploadProgress: ({ loaded, total }) => {
|
||||
if (total) {
|
||||
uploadAssetsStore.updateProgress(deviceAssetId, loaded, total);
|
||||
}
|
||||
onUploadProgress: ({ event }) => {
|
||||
const { loaded, total } = event;
|
||||
uploadAssetsStore.updateProgress(deviceAssetId, loaded, total);
|
||||
},
|
||||
},
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue