Skip to content

Commit

Permalink
Early return best return
Browse files Browse the repository at this point in the history
  • Loading branch information
neilenns committed Dec 2, 2024
1 parent 650d085 commit 85caaef
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions UI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2179,27 +2179,23 @@ private static void InstallWasmModule()
/// <returns></returns>
private static bool HandleWasmInstall(WasmModuleUpdater updater, bool isDifferent, string communityFolder, string msfsVersion)
{
bool result = false;

if (!String.IsNullOrEmpty(communityFolder))
if (String.IsNullOrEmpty(communityFolder))
{
if (isDifferent)
{
result = updater.InstallWasmModule(communityFolder);
Log.Instance.log($"Skipping WASM install for MSFS{msfsVersion} since no community folder was found. This likely means MSFS{msfsVersion} is not installed.", LogSeverity.Info);
return false;
}

if (result)
{
Log.Instance.log($"Successfully installed WASM module for MSFS{msfsVersion}.", LogSeverity.Info);
}
}
else
{
Log.Instance.log($"WASM module for MSFS{msfsVersion} is already up-to-date.", LogSeverity.Info);
}
if (!isDifferent)
{
Log.Instance.log($"WASM module for MSFS{msfsVersion} is already up-to-date.", LogSeverity.Info);
return false;
}
else

bool result = updater.InstallWasmModule(communityFolder);

if (result)
{
Log.Instance.log($"Skipping WASM install for MSFS{msfsVersion} since no community folder was found. This likely means MSFS{msfsVersion} is not installed.", LogSeverity.Info);
Log.Instance.log($"Successfully installed WASM module for MSFS{msfsVersion}.", LogSeverity.Info);
}

return result;
Expand Down

0 comments on commit 85caaef

Please sign in to comment.