Skip to content

Commit 03653ab

Browse files
committed
Fix an issue with UserSettings not saving properly.
1 parent 77411a9 commit 03653ab

4 files changed

Lines changed: 35 additions & 32 deletions

File tree

ArduinoTwitchBot.UI/ArduinoTwitchBot.UI.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<UseWPF>true</UseWPF>
77
<ApplicationIcon>ArduinoTwitch.ico</ApplicationIcon>
88
<AssemblyName>ArduinoTwitchBot</AssemblyName>
9+
<AssemblyVersion>1.1.0.0</AssemblyVersion>
10+
<FileVersion>1.1.0.0</FileVersion>
911
</PropertyGroup>
1012

1113
<ItemGroup>
@@ -29,6 +31,7 @@
2931
<None Update="Properties\Settings.settings">
3032
<Generator>SettingsSingleFileGenerator</Generator>
3133
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
34+
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
3235
</None>
3336
</ItemGroup>
3437

ArduinoTwitchBot.UI/Properties/Settings.Designer.cs

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ArduinoTwitchBot.UI/Properties/Settings.settings

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
<Setting Name="ClientId" Type="System.String" Scope="User">
99
<Value Profile="(Default)" />
1010
</Setting>
11+
<Setting Name="AccessToken" Type="System.String" Scope="User">
12+
<Value Profile="(Default)" />
13+
</Setting>
1114
<Setting Name="ChannelName" Type="System.String" Scope="User">
1215
<Value Profile="(Default)" />
1316
</Setting>
17+
<Setting Name="IsDarkTheme" Type="System.Boolean" Scope="User">
18+
<Value Profile="(Default)">False</Value>
19+
</Setting>
1420
<Setting Name="FollowAlert" Type="System.Boolean" Scope="User">
1521
<Value Profile="(Default)">False</Value>
1622
</Setting>
@@ -65,11 +71,5 @@
6571
<Setting Name="EmoteAlertType" Type="System.String" Scope="User">
6672
<Value Profile="(Default)" />
6773
</Setting>
68-
<Setting Name="AccessToken" Type="System.String" Scope="User">
69-
<Value Profile="(Default)" />
70-
</Setting>
71-
<Setting Name="IsDarkTheme" Type="System.Boolean" Scope="User">
72-
<Value Profile="(Default)">False</Value>
73-
</Setting>
7474
</Settings>
7575
</SettingsFile>

ArduinoTwitchBot.UI/UserSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static void SaveUserSettings()
8383
}
8484
catch (Exception ex)
8585
{
86-
throw ex;
86+
throw;
8787
}
8888
finally
8989
{
@@ -97,7 +97,7 @@ public static void LoadUserSettings()
9797
try
9898
{
9999
// Check if properties exist.
100-
PortName = Properties.Settings.Default["PortName"].ToString();
100+
PortName = Properties.Settings.Default.PortName.ToString();
101101
ClientId = Properties.Settings.Default["ClientId"].ToString();
102102
AccessToken = Properties.Settings.Default["AccessToken"].ToString();
103103
ChannelName = Properties.Settings.Default["ChannelName"].ToString();

0 commit comments

Comments
 (0)