2021-07-27 14:08:54 +02:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using BTCPayServer.Abstractions.Contracts;
|
|
|
|
|
using BTCPayServer.Services;
|
|
|
|
|
|
|
|
|
|
namespace BTCPayServer
|
|
|
|
|
{
|
|
|
|
|
public static class SettingsRepositoryExtensions
|
|
|
|
|
{
|
|
|
|
|
public static async Task<PoliciesSettings> GetPolicies(this ISettingsRepository settingsRepository)
|
|
|
|
|
{
|
2021-09-03 09:16:36 +02:00
|
|
|
|
return await settingsRepository.GetSettingAsync<PoliciesSettings>() ?? new PoliciesSettings();
|
2021-07-27 14:08:54 +02:00
|
|
|
|
}
|
|
|
|
|
public static async Task<ThemeSettings> GetTheme(this ISettingsRepository settingsRepository)
|
|
|
|
|
{
|
2021-09-03 09:16:36 +02:00
|
|
|
|
return await settingsRepository.GetSettingAsync<ThemeSettings>() ?? new ThemeSettings();
|
2021-07-27 14:08:54 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|