Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/App/Pages/Vault/ViewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
Grid.Column="0"
IsVisible="{Binding IsWebsite, Mode=OneWay}" />
<Label
Text="{Binding HostnameOrUri, Mode=OneWay}"
Text="{Binding HostOrUri, Mode=OneWay}"
StyleClass="box-value"
Grid.Row="1"
Grid.Column="0" />
Expand Down
16 changes: 8 additions & 8 deletions src/Core/Models/View/LoginUriView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class LoginUriView : View

private string _uri;
private string _domain;
private string _hostname;
private string _host;
private bool? _canLaunch;

public LoginUriView() { }
Expand Down Expand Up @@ -63,27 +63,27 @@ public string Domain
}
}

public string Hostname
public string Host
{
get
{
if (Match == UriMatchType.RegularExpression)
{
return null;
}
if (_hostname == null && Uri != null)
if (_host == null && Uri != null)
{
_hostname = CoreHelpers.GetHostname(Uri);
if (_hostname == string.Empty)
_host = CoreHelpers.GetHost(Uri);
if (_host == string.Empty)
{
_hostname = null;
_host = null;
}
}
return _hostname;
return _host;
}
}

public string HostnameOrUri => Hostname ?? Uri;
public string HostOrUri => Host ?? Uri;

public bool IsWebsite => Uri != null && (Uri.StartsWith("http://") || Uri.StartsWith("https://") ||
(Uri.Contains("://") && Regex.IsMatch(Uri, CoreHelpers.TldEndingRegex)));
Expand Down