From 04fc5ac4266917debbe0d79a7a489fb9647f0c48 Mon Sep 17 00:00:00 2001 From: Addison Schuhardt Date: Thu, 18 May 2023 11:05:41 -0700 Subject: [PATCH] use an appropriate default value for boolean settings BubbleID #1 --- Database/SettingsDatabase.cs | 6 +++--- Models/Setting.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Database/SettingsDatabase.cs b/Database/SettingsDatabase.cs index f78a65d..7354115 100644 --- a/Database/SettingsDatabase.cs +++ b/Database/SettingsDatabase.cs @@ -106,7 +106,7 @@ public bool InlineImages { get { - _inlineImages ??= GetBoolValue(); + _inlineImages ??= GetBoolValue(false); return _inlineImages.GetValueOrDefault(); } set @@ -120,7 +120,7 @@ public bool StrictTofuMode { get { - _strictTofuMode ??= GetBoolValue(); + _strictTofuMode ??= GetBoolValue(false); return _strictTofuMode.GetValueOrDefault(); } set @@ -134,7 +134,7 @@ public bool SaveVisited { get { - _storeVisited ??= GetBoolValue(); + _storeVisited ??= GetBoolValue(false); return _storeVisited.GetValueOrDefault(); } set diff --git a/Models/Setting.cs b/Models/Setting.cs index b5e0fff..8ae1e3e 100644 --- a/Models/Setting.cs +++ b/Models/Setting.cs @@ -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; }