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; } }