Skip to content

Commit

Permalink
Use Match
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 committed Dec 16, 2024
1 parent a235e0b commit bb84602
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,12 @@ public GuidedInstallerStepViewModel(IServiceProvider serviceProvider)
{
try
{
if (optionImage.TryPickT0(out var uri, out var imageStoredFile))
{
return await remoteImagePipeline.LoadResourceAsync(uri, CancellationToken.None);
}
else
{
return await fileImagePipeline.LoadResourceAsync(imageStoredFile.FileHash, CancellationToken.None);
}
return await optionImage.Match(
f0: uri => remoteImagePipeline.LoadResourceAsync(uri, CancellationToken.None),
f1: imageHash => fileImagePipeline.LoadResourceAsync(imageHash.FileHash, CancellationToken.None)
);
}
catch (Exception e)
catch (Exception)
{
return null;
}
Expand Down

0 comments on commit bb84602

Please sign in to comment.