FIX bug with incorrect importPath
This commit is contained in:
parent
942a552c8e
commit
5dee13c402
@ -272,14 +272,13 @@ public class TaskManager
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads stored data (settings, tasks) from file
|
/// Loads stored data (settings, tasks) from file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="importFolderPath">working directory, filename has to be data.json</param>
|
/// <param name="importFilePath">working directory, filename has to be data.json</param>
|
||||||
public static SettingsData LoadData(string importFolderPath)
|
public static SettingsData LoadData(string importFilePath)
|
||||||
{
|
{
|
||||||
string importPath = Path.Join(importFolderPath, "data.json");
|
if (!File.Exists(importFilePath))
|
||||||
if (!File.Exists(importPath))
|
|
||||||
return new SettingsData(Directory.GetCurrentDirectory(), null, null, new HashSet<TrangaTask>());
|
return new SettingsData(Directory.GetCurrentDirectory(), null, null, new HashSet<TrangaTask>());
|
||||||
|
|
||||||
string toRead = File.ReadAllText(importPath);
|
string toRead = File.ReadAllText(importFilePath);
|
||||||
SettingsData data = JsonConvert.DeserializeObject<SettingsData>(toRead)!;
|
SettingsData data = JsonConvert.DeserializeObject<SettingsData>(toRead)!;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
Loading…
Reference in New Issue
Block a user