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:
tyiuandClaude Sonnet 5 committed 2026-09-09 09:03:18 +03:00
1 parent f3f018741c
commit 583b9bd14e
3 files changed
+48 -16

No files matched your search

+10 -8
View File
@@ -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)
}
}
}