mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-19 00:51:30 -07:00
fixes and improvements
This commit is contained in:
parent
a5b7c916d4
commit
c90c90b574
@ -144,9 +144,19 @@ namespace Bloxstrap
|
||||
{
|
||||
// dont let user switch web environment if debug mode is not on
|
||||
if (Settings.Prop.WebEnvironment == WebEnvironment.Production || !Settings.Prop.DeveloperMode)
|
||||
return $"bloxstraplabs.com";
|
||||
return "bloxstraplabs.com";
|
||||
|
||||
return $"web-{Settings.Prop.WebEnvironment.GetDescription()}.bloxstraplabs.com";
|
||||
string? sub = Settings.Prop.WebEnvironment.GetDescription();
|
||||
return $"web-{sub}.bloxstraplabs.com";
|
||||
}
|
||||
|
||||
public static bool CanSendLogs()
|
||||
{
|
||||
// non developer mode always uses production
|
||||
if (!Settings.Prop.DeveloperMode || Settings.Prop.WebEnvironment == WebEnvironment.Production)
|
||||
return IsProductionBuild;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static async Task<GithubRelease?> GetLatestRelease()
|
||||
@ -190,7 +200,7 @@ namespace Bloxstrap
|
||||
|
||||
public static async void SendLog()
|
||||
{
|
||||
if (!Settings.Prop.EnableAnalytics || !IsProductionBuild)
|
||||
if (!Settings.Prop.EnableAnalytics || !CanSendLogs())
|
||||
return;
|
||||
|
||||
try
|
||||
|
@ -7,7 +7,15 @@ namespace Bloxstrap.Extensions
|
||||
{
|
||||
public static string? GetDescription<TEnum>(this TEnum e)
|
||||
{
|
||||
DescriptionAttribute? attribute = e?.GetType().GetCustomAttribute<DescriptionAttribute>();
|
||||
string? enumName = e.ToString();
|
||||
if (enumName == null)
|
||||
return null;
|
||||
|
||||
FieldInfo? field = e.GetType().GetField(enumName);
|
||||
if (field == null)
|
||||
return null;
|
||||
|
||||
DescriptionAttribute? attribute = field.GetCustomAttribute<DescriptionAttribute>();
|
||||
return attribute?.Description;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user