Crashing when there is no notifications.json file fixed
This commit is contained in:
@@ -122,13 +122,10 @@ namespace FoxTube
|
||||
|
||||
public async void Initialize()
|
||||
{
|
||||
if (await ApplicationData.Current.RoamingFolder.GetFileAsync("notifications.json") != null)
|
||||
{
|
||||
bool[] notificationsSettings = new bool[] { (bool)settings.Values["newVideoNotification"], (bool)settings.Values["devNews"] };
|
||||
await FileIO.WriteTextAsync(
|
||||
await ApplicationData.Current.RoamingFolder.CreateFileAsync("notifications.json", CreationCollisionOption.ReplaceExisting),
|
||||
JsonConvert.SerializeObject(notificationsSettings));
|
||||
}
|
||||
bool[] notificationsSettings = new bool[] { (bool)settings.Values["newVideoNotification"], (bool)settings.Values["devNews"] };
|
||||
await FileIO.WriteTextAsync(
|
||||
await ApplicationData.Current.RoamingFolder.CreateFileAsync("notifications.json", CreationCollisionOption.ReplaceExisting),
|
||||
JsonConvert.SerializeObject(notificationsSettings));
|
||||
}
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user