diff --git a/scripts/time_entry.gd b/scripts/time_entry.gd index c87f71b..87911d2 100644 --- a/scripts/time_entry.gd +++ b/scripts/time_entry.gd @@ -76,4 +76,4 @@ func from_csv_line(line: PackedStringArray) -> TimeEntry: return self func _to_string() -> String: - return "%s\t%s\t%s"%[name, Consts.ONGOING if closed == false else "", start_time] \ No newline at end of file + return "%s\t%s\t%s"%[name, Consts.ONGOING if closed == false else "", start_time] diff --git a/scripts/time_sheet.gd b/scripts/time_sheet.gd index 26ccd5f..1af5aea 100644 --- a/scripts/time_sheet.gd +++ b/scripts/time_sheet.gd @@ -43,6 +43,7 @@ func start_entry(entry_name: String) -> void: var file := FileAccess.open(source_path, FileAccess.READ_WRITE) if file == null: printerr("Could not open file") + return entries.append(current_entry) file.store_csv_line(current_entry.to_csv_line()) @@ -69,6 +70,7 @@ func save() -> void: var file := FileAccess.open(source_path, FileAccess.WRITE) if file == null: printerr("Could not open file") + return for time_entry in entries: file.store_csv_line(time_entry.to_csv_line())