mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use ValueTask as return value to suppress potential image error
This commit is contained in:
parent
f8675ed368
commit
710d2a89a2
1 changed files with 3 additions and 3 deletions
|
|
@ -35,7 +35,7 @@ namespace Flow.Launcher.ViewModel
|
||||||
? Result.SubTitle
|
? Result.SubTitle
|
||||||
: Result.SubTitleToolTip;
|
: Result.SubTitleToolTip;
|
||||||
|
|
||||||
private bool ImageLoaded;
|
private volatile bool ImageLoaded;
|
||||||
|
|
||||||
private ImageSource image = ImageLoader.DefaultImage;
|
private ImageSource image = ImageLoader.DefaultImage;
|
||||||
|
|
||||||
|
|
@ -46,13 +46,13 @@ namespace Flow.Launcher.ViewModel
|
||||||
if (!ImageLoaded)
|
if (!ImageLoaded)
|
||||||
{
|
{
|
||||||
ImageLoaded = true;
|
ImageLoaded = true;
|
||||||
LoadImage();
|
_ = LoadImageAsync();
|
||||||
}
|
}
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
private set => image = value;
|
private set => image = value;
|
||||||
}
|
}
|
||||||
private async void LoadImage()
|
private async ValueTask LoadImageAsync()
|
||||||
{
|
{
|
||||||
var imagePath = Result.IcoPath;
|
var imagePath = Result.IcoPath;
|
||||||
if (string.IsNullOrEmpty(imagePath) && Result.Icon != null)
|
if (string.IsNullOrEmpty(imagePath) && Result.Icon != null)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue