Skip to content

Commit 62a4290

Browse files
authored
Merge pull request #48 from DDDDDragon/fixFailedAttempts
Fix failed attempts not reloading correctly the data.win
2 parents d54dbab + 9b0fa52 commit 62a4290

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

Controls/ModInfos.xaml.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Threading.Tasks;
34
using System.Windows;
45
using System.Windows.Controls;
56
using ModShardLauncher.Mods;
@@ -48,7 +49,16 @@ private async void Save_Click(object sender, EventArgs e)
4849
MessageBox.Show(Application.Current.FindResource("SaveDataWarning").ToString());
4950
}
5051

51-
if (patchSucess) await DataLoader.DoSaveDialog();
52+
// attempt to save the patched data
53+
if (patchSucess)
54+
{
55+
Task<bool> save = DataLoader.DoSaveDialog();
56+
await save;
57+
if (!save.Result) Log.Information("Saved cancelled.");
58+
}
59+
60+
// reload the data
61+
await DataLoader.LoadFile(DataLoader.dataPath, true);
5262
Main.Instance.Refresh();
5363
}
5464

DataLoader.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ public static async Task SaveFile(string filename)
263263
//run
264264
dialog.ShowDialog();
265265
await t;
266-
await LoadFile(dataPath, true);
267266

268267
if (Main.Settings.SavePos == "")
269268
{

0 commit comments

Comments
 (0)