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