mirror of
https://github.com/bitwarden/mobile
synced 2025-12-19 09:43:27 +00:00
[PM-2671] Update mobile client to use regions (#2798)
* [PM-2671] Update mobile client to use regions * [PM-2671] Refactor * [PM-2671] Move migration of region to migration service. * [PM-2671] Move comment * [PM-2671] Change method name * [PM-2671] Change method name on usages --------- Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
This commit is contained in:
@@ -22,21 +22,7 @@ namespace Bit.Core.Models.View
|
||||
Email = a.Profile?.Email;
|
||||
Name = a.Profile?.Name;
|
||||
AvatarColor = a.Profile?.AvatarColor;
|
||||
Hostname = ParseEndpoint(a.Settings?.EnvironmentUrls);
|
||||
}
|
||||
|
||||
private string ParseEndpoint(EnvironmentUrlData urls)
|
||||
{
|
||||
var url = urls?.WebVault ?? urls?.Base;
|
||||
if (!string.IsNullOrWhiteSpace(url))
|
||||
{
|
||||
if (url.Contains("bitwarden.com") || url.Contains("bitwarden.eu"))
|
||||
{
|
||||
return CoreHelpers.GetDomain(url);
|
||||
}
|
||||
return CoreHelpers.GetHostname(url);
|
||||
}
|
||||
return string.Empty;
|
||||
Hostname = a.Settings?.EnvironmentUrls?.GetDomainOrHostname();
|
||||
}
|
||||
|
||||
public bool IsAccount { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user