fix(simple): clarify market price fallback copy
This commit is contained in:
parent
cc9268cee8
commit
6b2ddeb837
@ -116,7 +116,7 @@ export function buildSimpleSetupPayload(input: {
|
||||
|
||||
const currentMarketPrice = parsePositiveNumber(input.draft.currentMarketPrice);
|
||||
if (!currentMarketPrice) {
|
||||
throw new Error('Current market price is unavailable. Refresh market data and try again.');
|
||||
throw new Error('No recent market price is available right now. The app uses live price when available, otherwise the latest close.');
|
||||
}
|
||||
|
||||
const quantity = parsePositiveNumber(input.draft.quantity);
|
||||
@ -390,10 +390,10 @@ export function SimpleView() {
|
||||
if (Number.isFinite(lastClose) && lastClose > 0) {
|
||||
updateDraft('currentMarketPrice', lastClose.toFixed(4));
|
||||
} else {
|
||||
throw new Error('No recent market price available');
|
||||
throw new Error('No recent market data is available for this symbol right now.');
|
||||
}
|
||||
} catch (err: any) {
|
||||
setError(err?.message ?? 'Failed to load market price');
|
||||
setError(err?.message ?? 'Failed to load market data');
|
||||
} finally {
|
||||
setLoadingPrice(false);
|
||||
}
|
||||
@ -529,6 +529,9 @@ export function SimpleView() {
|
||||
readOnly
|
||||
className="bg-[var(--muted)] text-[var(--foreground)]"
|
||||
/>
|
||||
<span className="block text-[11px] text-[var(--muted-foreground)]">
|
||||
Uses live market price when available. Outside market hours, it falls back to the latest close.
|
||||
</span>
|
||||
</label>
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user