From 7c89ba4130169e96720a898f9bab5d15667e70d1 Mon Sep 17 00:00:00 2001 From: Piv <18462828+Piv200@users.noreply.github.com> Date: Sat, 11 Mar 2023 20:44:48 +1030 Subject: [PATCH] Fix output path in overhead allocation ios app --- FastCoster/FastCoster/OverheadAllocation.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FastCoster/FastCoster/OverheadAllocation.swift b/FastCoster/FastCoster/OverheadAllocation.swift index 813186d..7c53757 100644 --- a/FastCoster/FastCoster/OverheadAllocation.swift +++ b/FastCoster/FastCoster/OverheadAllocation.swift @@ -66,11 +66,14 @@ struct OverheadAllocation: View { func allocate_overheads() { DispatchQueue.global(qos: .userInitiated).async { - let finalDocument = TempFileDocument(url: tempPath) - allocate_overheads_from_text_to_file(lines, accounts, allocationStatistics, areas, costCentres, accountType, tempPath.absoluteString, false, show_from) + // Cut off file:// + // TODO: There has to be a better way to do string slicing right? + let tempPathString = String(tempPath.absoluteString.dropFirst(7)) + + allocate_overheads_from_text_to_file(lines, accounts, allocationStatistics, areas, costCentres, accountType, tempPathString, false, show_from) DispatchQueue.main.async { - document = finalDocument + document = TempFileDocument(url: tempPath) showExportPicker = true; } }