Fix output path in overhead allocation ios app

This commit is contained in:
Piv
2023-03-11 20:44:48 +10:30
parent f5bc441fdb
commit 7c89ba4130

View File

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