Make all tasks run in parallel to increase responsiveness and efficiency when fetching new data. However, parallel tasks means that toast errors are no longer feasible. Instead, add a logging system which has a more detailed view of app messages and direct the user there if there is an error. Signed-off-by: kingbri <bdashore3@proton.me>
33 lines
751 B
Swift
33 lines
751 B
Swift
//
|
|
// SettingsLogView.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 3/8/23.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct SettingsLogView: View {
|
|
@EnvironmentObject var logManager: LoggingManager
|
|
|
|
var body: some View {
|
|
NavView {
|
|
List {
|
|
ForEach(logManager.messageArray, id: \.self) { log in
|
|
Text(log.toMessage())
|
|
.font(.caption)
|
|
.foregroundColor(.secondary)
|
|
}
|
|
}
|
|
.listStyle(.plain)
|
|
.navigationTitle("Logs")
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
}
|
|
}
|
|
}
|
|
|
|
struct SettingsLogView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
SettingsLogView()
|
|
}
|
|
}
|