Skip to content

Commit

Permalink
fix: Preventing redirect when navigating back
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrandolph committed Jul 24, 2023
1 parent 0c2d807 commit ec385b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Uno.Extensions.Navigation/NavigatorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ public static IRouteResolver GetResolver(this INavigator navigator)
public static Task<NavigationResponse?> NavigateBackWithResultAsync<TResult>(
this INavigator navigator, object sender, string qualifier = Qualifiers.None, Option<TResult>? data = null, CancellationToken cancellation = default)
{
var hint = new RouteHint { Route = Qualifiers.NavigateBack, Qualifier = qualifier };
var hint = new RouteHint { Route = Qualifiers.NavigateBack, Qualifier = qualifier, Result = typeof(TResult) };
return navigator.NavigateRouteHintAsync(hint, sender, data, cancellation);
}

public static Task<NavigationResponse?> NavigateBackWithResultAsync(
this INavigator navigator, object sender, string qualifier = Qualifiers.None, object? data = null, CancellationToken cancellation = default)
{
var hint = new RouteHint { Route = Qualifiers.NavigateBack, Qualifier = qualifier };
var hint = new RouteHint { Route = Qualifiers.NavigateBack, Qualifier = qualifier, Result = data?.GetType() };
return navigator.NavigateRouteHintAsync(hint, sender, data, cancellation);
}

Expand Down Expand Up @@ -246,7 +246,7 @@ public static async Task ShowMessageDialogAsync(
// as the RouteHint will use the data type to determine request route. However,
// if the NavigationRequest has been manually prepared with data, this logic will
// update the request based on the type of data.
if (string.IsNullOrWhiteSpace(request.Route.Base) &&
if (request.Route.IsEmpty() &&
request.Route.NavigationData() is { } navData)
{
var maps = resolver.FindByData(navData.GetType(), navigator);
Expand Down

0 comments on commit ec385b3

Please sign in to comment.