Skip to content

Commit 89dbefd

Browse files
captainsafiagfoidl
andauthored
Apply suggestions from code review
Co-authored-by: Günther Foidl <[email protected]>
1 parent f2cb4a2 commit 89dbefd

File tree

1 file changed

+2
-6
lines changed
  • src/Components/Components/src/Routing

1 file changed

+2
-6
lines changed

src/Components/Components/src/Routing/Router.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ internal async Task<bool> RunOnNavigateAsync(string path)
200200
// then we render the component associated with the route as per usual.
201201
if (!OnNavigateAsync.HasDelegate)
202202
{
203-
return await Task.FromResult(true);
203+
return true;
204204
}
205205

206206
// If we've already invoked a task and stored its CTS, then
@@ -226,11 +226,7 @@ internal async Task<bool> RunOnNavigateAsync(string path)
226226
}
227227

228228
var completedTask = await Task.WhenAny(task, cancellationTcs.Task);
229-
if (completedTask == task)
230-
{
231-
return await Task.FromResult(true);
232-
}
233-
return await Task.FromResult(false);
229+
return task == completedTask;
234230
}
235231

236232
private async Task RunOnNavigateWithRefreshAsync(string path, bool isNavigationIntercepted)

0 commit comments

Comments
 (0)