mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 11:58:59 +03:00
fix(web): toast warning when trying to upload unsupported file type (#26492)
This commit is contained in:
@@ -2307,6 +2307,7 @@
|
|||||||
"unstack_action_prompt": "{count} unstacked",
|
"unstack_action_prompt": "{count} unstacked",
|
||||||
"unstacked_assets_count": "Un-stacked {count, plural, one {# asset} other {# assets}}",
|
"unstacked_assets_count": "Un-stacked {count, plural, one {# asset} other {# assets}}",
|
||||||
"unsupported_field_type": "Unsupported field type",
|
"unsupported_field_type": "Unsupported field type",
|
||||||
|
"unsupported_file_type": "File {file} can't be uploaded because its file type {type} is not supported.",
|
||||||
"untagged": "Untagged",
|
"untagged": "Untagged",
|
||||||
"untitled_workflow": "Untitled workflow",
|
"untitled_workflow": "Untitled workflow",
|
||||||
"up_next": "Up next",
|
"up_next": "Up next",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
getBaseUrl,
|
getBaseUrl,
|
||||||
type AssetMediaResponseDto,
|
type AssetMediaResponseDto,
|
||||||
} from '@immich/sdk';
|
} from '@immich/sdk';
|
||||||
|
import { toastManager } from '@immich/ui';
|
||||||
import { tick } from 'svelte';
|
import { tick } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import { get } from 'svelte/store';
|
import { get } from 'svelte/store';
|
||||||
@@ -112,6 +113,10 @@ export const fileUploadHandler = async ({
|
|||||||
promises.push(
|
promises.push(
|
||||||
uploadExecutionQueue.addTask(() => fileUploader({ assetFile: file, deviceAssetId, albumId, isLockedAssets })),
|
uploadExecutionQueue.addTask(() => fileUploader({ assetFile: file, deviceAssetId, albumId, isLockedAssets })),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
toastManager.warning(get(t)('unsupported_file_type', { values: { file: file.name, type: file.type } }), {
|
||||||
|
timeout: 10_000,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user