[PM-2347] Refresh feature flags when environment urls change (#2538)

This commit is contained in:
André Bispo 2023-05-25 14:37:53 +01:00 committed by GitHub
parent 79241731e7
commit c7fd113f26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,6 +165,7 @@ namespace Bit.App.Pages
public async Task ShowEnvironmentPickerAsync() public async Task ShowEnvironmentPickerAsync()
{ {
_displayEuEnvironment = await _configService.GetFeatureFlagBoolAsync(Constants.DisplayEuEnvironmentFlag);
var options = _displayEuEnvironment var options = _displayEuEnvironment
? new string[] { AppResources.US, AppResources.EU, AppResources.SelfHosted } ? new string[] { AppResources.US, AppResources.EU, AppResources.SelfHosted }
: new string[] { AppResources.US, AppResources.SelfHosted }; : new string[] { AppResources.US, AppResources.SelfHosted };
@ -185,6 +186,7 @@ namespace Bit.App.Pages
} }
await _environmentService.SetUrlsAsync(result == AppResources.EU ? EnvironmentUrlData.DefaultEU : EnvironmentUrlData.DefaultUS); await _environmentService.SetUrlsAsync(result == AppResources.EU ? EnvironmentUrlData.DefaultEU : EnvironmentUrlData.DefaultUS);
await _configService.GetAsync(true);
SelectedEnvironmentName = result; SelectedEnvironmentName = result;
}); });
} }
@ -210,6 +212,7 @@ namespace Bit.App.Pages
} }
else else
{ {
await _configService.GetAsync(true);
SelectedEnvironmentName = AppResources.SelfHosted; SelectedEnvironmentName = AppResources.SelfHosted;
} }
} }