Skip to content
Merged
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions Flagsmith.FlagsmithClient/Flags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
}
public async Task<string> GetFeatureValue(string featureName) => (await GetFlag(featureName)).Value;
public async Task<bool> IsFeatureEnabled(string featureName) => (await GetFlag(featureName)).Enabled;
public async Task<IFlag> GetFlag(string featureName)
public Task<IFlag> GetFlag(string featureName)
{
var flag = _Flags?.FirstOrDefault(f => f.GetFeatureName().Equals(featureName));
if (flag == null)
{
return _DefaultFlagHandler?.Invoke(featureName) ?? throw new FlagsmithClientError("Feature does not exist: " + featureName);
return Task.FromResult(_DefaultFlagHandler?.Invoke(featureName) ?? throw new FlagsmithClientError("Feature does not exist: " + featureName));

}
if (_AnalyticsProcessor != null)
await _AnalyticsProcessor.TrackFeature(flag.GetFeatureName()).ConfigureAwait(false);
return flag;
_ = _AnalyticsProcessor.TrackFeature(flag.GetFeatureName())

Check failure on line 32 in Flagsmith.FlagsmithClient/Flags.cs

View workflow job for this annotation

GitHub Actions / Check Build and formatting (Flagsmith.FlagsmithClient)

; expected

Check failure on line 32 in Flagsmith.FlagsmithClient/Flags.cs

View workflow job for this annotation

GitHub Actions / Check Build and formatting (Flagsmith.FlagsmithClient)

; expected

Check failure on line 32 in Flagsmith.FlagsmithClient/Flags.cs

View workflow job for this annotation

GitHub Actions / Check Build and formatting (Flagsmith.Engine)

; expected

Check failure on line 32 in Flagsmith.FlagsmithClient/Flags.cs

View workflow job for this annotation

GitHub Actions / Check Build and formatting (Flagsmith.Engine)

; expected

Check failure on line 32 in Flagsmith.FlagsmithClient/Flags.cs

View workflow job for this annotation

GitHub Actions / Test (Flagsmith.Client.Test, 6.0.x)

; expected
return Task.FromResult(flag);
}
public List<IFlag> AllFlags() => _Flags;
private static IFlag FromFeatureStateModel(FeatureStateModel featureStateModel, string identityId = null) =>
Expand Down
Loading