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