From 645e798d97acb67af68247006358712e2395d2b7 Mon Sep 17 00:00:00 2001 From: Samuel Chapleau Date: Fri, 13 Jan 2023 14:20:10 -0800 Subject: [PATCH] Move check for png thubmnail loading priority --- .../Previewers/PngPreviewer/PngPreviewer.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/peek/Peek.FilePreviewer/Previewers/PngPreviewer/PngPreviewer.cs b/src/modules/peek/Peek.FilePreviewer/Previewers/PngPreviewer/PngPreviewer.cs index dc11b01601..3fcd02a4fb 100644 --- a/src/modules/peek/Peek.FilePreviewer/Previewers/PngPreviewer/PngPreviewer.cs +++ b/src/modules/peek/Peek.FilePreviewer/Previewers/PngPreviewer/PngPreviewer.cs @@ -124,14 +124,15 @@ namespace Peek.FilePreviewer.Previewers { cancellationToken.ThrowIfCancellationRequested(); - if (!IsFullImageLoaded) + await Dispatcher.RunOnUiThread(async () => { - await Dispatcher.RunOnUiThread(async () => + cancellationToken.ThrowIfCancellationRequested(); + var thumbnail = await ThumbnailHelper.GetThumbnailAsync(File, _png_image_size); + if (!IsFullImageLoaded) { - cancellationToken.ThrowIfCancellationRequested(); - Preview = await ThumbnailHelper.GetThumbnailAsync(File, _png_image_size); - }); - } + Preview = thumbnail; + } + }); }); }