Skip to content

Commit

Permalink
Trying to fix crash on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaskohl committed Apr 5, 2021
1 parent 126d541 commit 2e70bec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CapsLockIndicatorV3/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private static void Main(string[] args)

SettingsManager.Save();

if (SettingsManager.Get<bool>("beta_enableDarkMode"))
if (DarkModeProvider.IsDark)
Native.SetPrefferDarkMode(true);

var runApp = true;
Expand Down
4 changes: 2 additions & 2 deletions CapsLockIndicatorV3/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("3.11.0.0")]
[assembly: AssemblyFileVersion("3.11.0.0")]
[assembly: AssemblyVersion("3.11.1.0")]
[assembly: AssemblyFileVersion("3.11.1.0")]
[assembly: Guid ("6f54c357-0542-4d7d-9225-338bc3cd7834")]
4 changes: 4 additions & 0 deletions CapsLockIndicatorV3/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ private static void LoadUser()

public static object Get(string key)
{
if (!Has(key))
return null;
var d = Settings[key];
return Convert.ChangeType(d.Item2, d.Item1);
}

public static T Get<T>(string key)
{
if (!Has(key))
return default(T);
var d = Settings[key];
if (typeof(T).IsEnum)
return (T)Enum.Parse(typeof(T), d.Item2.ToString());
Expand Down

0 comments on commit 2e70bec

Please sign in to comment.