Hide refresh for Manual, seed its rate from another source
Refreshing has no meaning for a manually-typed rate, so the button (and its loading spinner) is now hidden while Manual is selected. Switching to Manual for the first time now seeds its rate field from whichever source was active before, falling back to any other source's last cached rate for the default currency. When neither is available, the rate and amount fields are left empty instead of showing stale values. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
@@ -65,15 +65,17 @@ struct ContentView: View {
|
||||
} else {
|
||||
Spacer()
|
||||
}
|
||||
if state.isLoading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Button {
|
||||
viewModel.refresh()
|
||||
} label: {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
if !state.isManualSource {
|
||||
if state.isLoading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Button {
|
||||
viewModel.refresh()
|
||||
} label: {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user