Skip to content

Commit 1d2b32c

Browse files
committed
Return success status from HashesResources method
The HashesResources method now returns a boolean indicating success. The calling code checks this result before proceeding to delay and launch the process, improving error handling and flow control.
1 parent 15d783a commit 1d2b32c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Bundle/Sucrose.Bundle/Main.xaml.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ private static async Task ExtractResources(string SourcePath, string ExtractPath
446446
}
447447
}
448448

449-
private static async Task HashesResources(string SourcePath, string DestinationPath)
449+
private static async Task<bool> HashesResources(string SourcePath, string DestinationPath)
450450
{
451451
bool Result = true;
452452

@@ -529,6 +529,8 @@ private static async Task HashesResources(string SourcePath, string DestinationP
529529
{
530530
Process.Start(TemplateFilePath);
531531
}
532+
533+
return Result;
532534
}
533535

534536
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
@@ -592,11 +594,12 @@ private async void Window_ContentRendered(object sender, EventArgs e)
592594

593595
await Task.Delay(MinDelay);
594596

595-
await HashesResources(Checksum, InstallPath);
596-
597-
await Task.Delay(MinDelay);
597+
if (await HashesResources(Checksum, InstallPath))
598+
{
599+
await Task.Delay(MinDelay);
598600

599-
Process.Start(Launcher);
601+
Process.Start(Launcher);
602+
}
600603

601604
await Task.Delay(MinDelay);
602605

0 commit comments

Comments
 (0)