Fix downloadFile
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Core.Interface.IntegryApi
|
||||
@@ -34,12 +35,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<OverlayLayout Visible="VisibleOverlay" />
|
||||
|
||||
@code {
|
||||
[Parameter] public CRMAttachedResponseDTO Attached { get; set; } = new();
|
||||
|
||||
private bool VisibleOverlay { get; set; }
|
||||
|
||||
private async Task OpenAttached()
|
||||
{
|
||||
var bytes = await IntegryApiService.DownloadFileFromRefUuid(Attached.RefUuid, Attached.FileName);
|
||||
await AttachedService.OpenFile(bytes, Attached.FileName);
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
await using var file = await IntegryApiService.DownloadFileFromRefUuid(Attached.RefUuid, Attached.FileName);
|
||||
var path = await AttachedService.SaveToTempStorage(file, Attached.FileName);
|
||||
|
||||
VisibleOverlay = false;
|
||||
StateHasChanged();
|
||||
|
||||
await AttachedService.OpenFile(Attached.FileName, path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user