Skip to content

Commit

Permalink
Hotfix for migrating invalid settings
Browse files Browse the repository at this point in the history
  • Loading branch information
newcat committed Oct 2, 2016
1 parent 906c37d commit ac95e2b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
22 changes: 19 additions & 3 deletions tvdc/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
Expand Down Expand Up @@ -30,9 +31,24 @@ private async void Application_Startup(object sender, StartupEventArgs e)
tvdc.Properties.Settings.Default.Reload();
if (tvdc.Properties.Settings.Default.upgradeRequired)
{
tvdc.Properties.Settings.Default.Upgrade();
tvdc.Properties.Settings.Default.upgradeRequired = false;
tvdc.Properties.Settings.Default.Save();

try
{
tvdc.Properties.Settings.Default.GetPreviousVersion("name");

tvdc.Properties.Settings.Default.Reset();
tvdc.Properties.Settings.Default.upgradeRequired = false;
tvdc.Properties.Settings.Default.Save();

} catch (SettingsPropertyNotFoundException)
{
//If setting could not be found it means we will also have
//a valid oauth code in previous settings
tvdc.Properties.Settings.Default.Upgrade();
tvdc.Properties.Settings.Default.upgradeRequired = false;
tvdc.Properties.Settings.Default.Save();
}

}

if (! await AccountManager.Login())
Expand Down
6 changes: 3 additions & 3 deletions tvdc/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: nUpdateVersion("1.4.0.0")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.0")]
[assembly: nUpdateVersion("1.4.1.0")]

0 comments on commit ac95e2b

Please sign in to comment.