aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-01 22:48:11 -0700
committerAdam Soltys <[email protected]>2026-10-01 22:48:11 -0700
commit23f18ff13e0a8c612d04727de2ccfadf2d13ff7c (patch)
tree578915726c8b4285d6e0dcaedb6d24049996d773 /src/app.js
parentc6b279abd5e502ce05c1418797714782356b7707 (diff)
downloadcoinosv3-23f18ff13e0a8c612d04727de2ccfadf2d13ff7c.tar.gz
coinosv3-23f18ff13e0a8c612d04727de2ccfadf2d13ff7c.zip
Shared note links open on the post, with names and faces
The server renders /nevent1 and /note1 pages with the thread inlined (post, root, replies, kind 0s) and Open Graph tags; the client seeds its thread cache from it and opens the thread on the first paint. Without it, a pending frame holds the screen instead of the front door. Profile lookups ask our relays and the profile indexes at once, streamed, instead of one after the other behind five-second waits. A thread opened straight from a link has no Back button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index 7131476..64564be 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1014,6 +1014,9 @@ function goBack(toParent) {
if (navIndex > 0) history.back();
else { toParent(); render(); }
}
+// Whether an in-app Back has anywhere of ours to go. A page opened straight
+// from a link has nothing under it; its Back would invent a parent.
+const canGoBack = () => navIndex > 0;
// ---------------------------------------------------------------- utilities
let toastTimer;
@@ -5710,7 +5713,7 @@ async function importSnapshotFile(e) {
// sits just before boot so every helper it captures is defined; the hooks are
// only invoked at runtime (first render happens after loadLocale below).
const ctx = {
- h, ui, render, wallet, toast, copy, copyBtn, pasteBtn, blankSend, goBack, goHome, openExternal, showSend,
+ h, ui, render, wallet, toast, copy, copyBtn, pasteBtn, blankSend, goBack, canGoBack, goHome, openExternal, showSend,
fmtAmount, unitLabel, unitTag, getUnit: () => unit, toggleUnit, download,
// in fiat the typed figure is money, so it needs today's price to become sats
parseAmount: (v, u) => parseAmount(v, u, rateNow()),