mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Dont show export button when there are no logs to export, use content unavailable view for a loading indicator.
This commit is contained in:
parent
b31998be6c
commit
1c7c102090
1 changed files with 14 additions and 6 deletions
|
|
@ -54,6 +54,12 @@ struct AppLog: View {
|
|||
|
||||
}
|
||||
.searchable(text: $searchTerm, prompt: "Search")
|
||||
.disabled(selection != nil)
|
||||
.overlay {
|
||||
if logs.isEmpty {
|
||||
ContentUnavailableView("Getting Logs . . .", systemImage: "scroll")
|
||||
}
|
||||
}
|
||||
.onChange(of: sortOrder) { _, sortOrder in
|
||||
withAnimation {
|
||||
logs.sort(using: sortOrder)
|
||||
|
|
@ -90,12 +96,14 @@ struct AppLog: View {
|
|||
)
|
||||
.navigationBarTitle("Debug Logs", displayMode: .inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button(action: {
|
||||
exportString = logToCsvFile(log: logs)
|
||||
isExporting = true
|
||||
}) {
|
||||
Image(systemName: "square.and.arrow.down")
|
||||
if !logs.isEmpty {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button(action: {
|
||||
exportString = logToCsvFile(log: logs)
|
||||
isExporting = true
|
||||
}) {
|
||||
Image(systemName: "square.and.arrow.down")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue