Skip to content

Commit

Permalink
use an appropriate default value for boolean settings
Browse files Browse the repository at this point in the history
BubbleID #1
  • Loading branch information
aschuhardt committed May 18, 2023
1 parent 6515d92 commit 04fc5ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Database/SettingsDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public bool InlineImages
{
get
{
_inlineImages ??= GetBoolValue();
_inlineImages ??= GetBoolValue(false);
return _inlineImages.GetValueOrDefault();
}
set
Expand All @@ -120,7 +120,7 @@ public bool StrictTofuMode
{
get
{
_strictTofuMode ??= GetBoolValue();
_strictTofuMode ??= GetBoolValue(false);
return _strictTofuMode.GetValueOrDefault();
}
set
Expand All @@ -134,7 +134,7 @@ public bool SaveVisited
{
get
{
_storeVisited ??= GetBoolValue();
_storeVisited ??= GetBoolValue(false);
return _storeVisited.GetValueOrDefault();
}
set
Expand Down
2 changes: 1 addition & 1 deletion Models/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Setting
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
[Indexed]
[Indexed(Unique = true)]
public string Name { get; set; }
public string StringValue { get; set; }
public int IntValue { get; set; }
Expand Down

0 comments on commit 04fc5ac

Please sign in to comment.