summaryrefslogtreecommitdiff
path: root/client/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/client.go')
-rw-r--r--client/client.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/client/client.go b/client/client.go
index 73f94d3..cfb95eb 100644
--- a/client/client.go
+++ b/client/client.go
@@ -517,6 +517,16 @@ func (c *Client) SetSecureLocation(orgID string, countryCode string) error {
return i18nerr.Wrapf(err, "Failed to get the secure internet server with id: '%s' for setting a location", orgID)
}
srv.CountryCode = countryCode
+
+ // no cached location profiles
+ if srv.LocationProfiles == nil {
+ return nil
+ }
+
+ // restore profile from the location
+ if v, ok := srv.LocationProfiles[srv.CountryCode]; ok {
+ srv.Profiles.Current = v
+ }
return nil
}