Added error handling notification (#536)

This commit is contained in:
Alex 2022-08-26 10:36:41 -07:00 committed by GitHub
parent 33b810de74
commit 4be9aa091b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 118 additions and 26 deletions

View file

@ -9,6 +9,10 @@
import { downloadAssets } from '$lib/stores/download';
import VideoViewer from './video-viewer.svelte';
import { api, AssetResponseDto, AssetTypeEnum } from '@api';
import {
notificationController,
NotificationType
} from '../shared-components/notification/notification';
export let asset: AssetResponseDto;
@ -115,7 +119,11 @@
}, 2000);
}
} catch (e) {
console.log('Error downloading file ', e);
console.error('Error downloading file ', e);
notificationController.show({
type: NotificationType.Error,
message: 'Error downloading file, check console for more details.'
});
}
};
</script>

View file

@ -1,7 +1,7 @@
<script lang="ts">
import { fade } from 'svelte/transition';
import { createEventDispatcher, onMount } from 'svelte';
import { onMount } from 'svelte';
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
import { api, AssetResponseDto } from '@api';
@ -10,8 +10,6 @@
let assetInfo: AssetResponseDto;
const dispatch = createEventDispatcher();
onMount(async () => {
const { data } = await api.assetApi.getAssetById(assetId);
assetInfo = data;