From 5dee13c402e3e5a48e42e2e66c0631929bb7b5d7 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 21 May 2023 15:26:53 +0200 Subject: [PATCH] FIX bug with incorrect importPath --- Tranga/TaskManager.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Tranga/TaskManager.cs b/Tranga/TaskManager.cs index 7e454ed..59efb5e 100644 --- a/Tranga/TaskManager.cs +++ b/Tranga/TaskManager.cs @@ -272,14 +272,13 @@ public class TaskManager /// /// Loads stored data (settings, tasks) from file /// - /// working directory, filename has to be data.json - public static SettingsData LoadData(string importFolderPath) + /// working directory, filename has to be data.json + public static SettingsData LoadData(string importFilePath) { - string importPath = Path.Join(importFolderPath, "data.json"); - if (!File.Exists(importPath)) + if (!File.Exists(importFilePath)) return new SettingsData(Directory.GetCurrentDirectory(), null, null, new HashSet()); - string toRead = File.ReadAllText(importPath); + string toRead = File.ReadAllText(importFilePath); SettingsData data = JsonConvert.DeserializeObject(toRead)!; return data;