diff options
| author | Adam Soltys <[email protected]> | 2026-11-02 15:45:22 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-02 15:45:22 -0700 |
| commit | 347dbe7fde3ba70a53ac4258737fe25ab39fd96d (patch) | |
| tree | 7586367cb317920e8b53f3ab52f4edb601997444 /src/routes/(app) | |
| parent | 3e3aacdabb9ad360280fdffa8da2d085d797d682 (diff) | |
| download | coinos-ui-347dbe7fde3ba70a53ac4258737fe25ab39fd96d.tar.gz coinos-ui-347dbe7fde3ba70a53ac4258737fe25ab39fd96d.zip | |
Lightning send: the max routing fee field is a number, so the total adds it instead of gluing its digits onto the amount. "The max fee reserve paying a lightning invoice is not in sats. Putting a 1 makes it like 10 million sats or something" (mrecheese via Adam, 2026-11-02): the input had no type, so Svelte bound the typed text and amount + maxfee + ourfee concatenated — a 10,000-sat send with a 1 typed in read as ⚡️10000110. The server already parsed the fee as an integer, so only the shown total was wrong.HEADmaster
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6TFgisGKUDhdStLUvs
Diffstat (limited to 'src/routes/(app)')
| -rw-r--r-- | src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte index 7b42a42d..5f64edd1 100644 --- a/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte +++ b/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte @@ -39,7 +39,10 @@ ); $effect(() => (maxfee = quoted ? fee : fallback)); - let total = $derived((amount || 0) + (maxfee || 0) + (ourfee || 0)); + // maxfee comes back from the input as whatever was typed: as a number + // here, so the total adds it rather than gluing the digits on ("1" made + // a 10,000-sat send read as ten million) + let total = $derived((Number(amount) || 0) + (Number(maxfee) || 0) + (Number(ourfee) || 0)); // Server-side messages worth showing verbatim: a balance shortfall, or the // pre-flight check that the max fee is below what routing now costs. @@ -162,6 +165,10 @@ <input id="maxfee" name="fee" + type="number" + min="0" + step="1" + inputmode="numeric" bind:value={maxfee} class="clean !grow" /> |
