Skip to content

Commit

Permalink
added OnInitialized again
Browse files Browse the repository at this point in the history
  • Loading branch information
GyroGearl00se committed Jun 19, 2024
1 parent 64102a4 commit 115f010
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Components/Pages/QueueBrowser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@inject QueueBrowserService QueueBrowserService
@inject ILogger<QueueBrowser> Logger
@inject Blazored.Toast.Services.IToastService toastService
@inject NavigationManager Navigation

<Layout>
<Title>Queue Browser</Title>
Expand Down Expand Up @@ -201,4 +202,37 @@
deletingMessageId = "";
}
}

protected override void OnInitialized()
{
var uri = Navigation.ToAbsoluteUri(Navigation.Uri);
var queryParams = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query);

if (queryParams.TryGetValue("host", out var hostValue))
{
host = hostValue;
}

if (queryParams.TryGetValue("vpn", out var vpnValue))
{
vpnName = vpnValue;
}

if (queryParams.TryGetValue("queue", out var queueValue))
{
queueName = queueValue;
}

if (queryParams.TryGetValue("username", out var usernameValue))
{
username = usernameValue;
}

if (queryParams.TryGetValue("hostname", out var hostnameValue))
{
host = hostnameValue;
}

password = string.Empty;
}
}

0 comments on commit 115f010

Please sign in to comment.