diff options
| author | Adam Soltys <[email protected]> | 2026-09-28 22:58:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-28 22:58:40 -0700 |
| commit | c0e428aff3ff34fec56a434bc1837e49ab9c1a81 (patch) | |
| tree | 63bb5e1f314d2a53b9551be17bf6fa4a261958e4 /src/feed-cache.js | |
| parent | 86d5609a188ce4dae248d1b56c4563bae299af31 (diff) | |
| download | coinosv3-c0e428aff3ff34fec56a434bc1837e49ab9c1a81.tar.gz coinosv3-c0e428aff3ff34fec56a434bc1837e49ab9c1a81.zip | |
Polls (NIP-88): options with each one's share of the vote, votable from the feed and the thread.
A kind 1068 poll showed as "an event this app doesn't show". Now its
options are rows with the vote share behind them (kind 1018 votes, each
person's latest counts, single/multiple choice, endsAt honored); a tap
votes, marked as yours at once. A quoted poll is pictured in its card.
Feeds and profiles list polls alongside notes, and a thread's root is
looked up by id with any kind, so replies to a poll find it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Du1qT1wbkYwYK6zkGH79Rp
Diffstat (limited to 'src/feed-cache.js')
| -rw-r--r-- | src/feed-cache.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/feed-cache.js b/src/feed-cache.js index ea562f7..7394393 100644 --- a/src/feed-cache.js +++ b/src/feed-cache.js @@ -3,7 +3,7 @@ export const FEED_CACHE_POSTS = 30; const MAX_FEEDS = 4, MAX_UNITS = 256_000, MAX_AGE = 7 * 86400_000; export function createFeedCache(storage, prefix, now = Date.now) { const keyOf = (id) => id === 'following' ? prefix : prefix + ':' + id; - const valid = (e) => e?.kind === 1 && typeof e.id === 'string' && typeof e.pubkey === 'string' + const valid = (e) => (e?.kind === 1 || e?.kind === 1068) && typeof e.id === 'string' && typeof e.pubkey === 'string' && typeof e.content === 'string' && Number.isFinite(e.created_at) && Array.isArray(e.tags); function compact(notes) { const kept = []; let size = 0; |
