diff --git a/ROADMAP.md b/ROADMAP.md index 2af1e90b..0a32cc9e 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,22 +2,10 @@ - [ ] Claim relays bounty - [ ] Add real search, it's a big hurdle for first-timers/anons -- [ ] Fix notifications -- [ ] Queue context requests to avoid having too many concurrent subscriptions -- [ ] Advanced search - - Select timeframe, authors, p tags, t tags -- [ ] Some lnurls aren't working npub1y3k2nheva29y9ej8a22e07epuxrn04rvgy28wvs54y57j7vsxxuq0gvp4j -- [ ] Global search modal that searches within current feed -- [ ] Fix force relays on login: http://localhost:5173/messages/npub1l66wvfm7dxhd6wmvpukpjpyhvwtlxzu0qqajqxjfpr4rlfa8hl5qlkfr3q +- [ ] Remember message/chat status - [ ] Image classification - https://github.com/bhky/opennsfw2 -# Custom views - -- [ ] Add customize icon and route with editable custom view cards using "lists" nip - - nevent1qqspjcqw2hu5gfcpkrjhs0aqvxuzjgtp50l375mcqjfpmk48cg5hevgpr3mhxue69uhkummnw3ez6un9d3shjtnhd3m8xtnnwpskxegpzamhxue69uhkummnw3ezuendwsh8w6t69e3xj7spramhxue69uhkummnw3ez6un9d3shjtnwdahxxefwv93kzer9d4usz9rhwden5te0wfjkccte9ejxzmt4wvhxjmcpr9mhxue69uhkummnw3ezuer9d3hjuum0ve68wctjv5n8hwfg - - [ ] Custom views should combine pubkeys, relays, event ids, and topics - # Core - [ ] Make mutes private @@ -59,11 +47,11 @@ # UI/Features -- [ ] Remember message/chat status - [ ] Allow sharing of lists/following other people's lists - [ ] Add suggestion list for topics on compose - [ ] Badges link to https://badges.page/p/97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322 - [ ] Add QR code that pre-fills follows and relays for a new user +- [ ] Advanced search: select timeframe, authors, p tags, t tags - If logged in, open a detail page that shows the relays and people - If not logged in, pre-populate follows/relays in onboarding flow - [ ] If someone logs in with their private key, create a notification to install an extension diff --git a/src/agent/db.ts b/src/agent/db.ts index 98875f32..ed443574 100644 --- a/src/agent/db.ts +++ b/src/agent/db.ts @@ -195,8 +195,8 @@ export const dropAll = () => new Promise(resolve => loki.deleteDatabase(resolve) // ---------------------------------------------------------------------------- // Domain-specific collections -const sortByCreatedAt = sortBy(prop("created_at")) -const sortByLastSeen = sortBy(prop("last_seen")) +const sortByCreatedAt = sortBy(e => -e.created_at) +const sortByLastSeen = sortBy(e => -e.last_seen) export const people = new Table("people", "pubkey", { max: 5000, diff --git a/src/app/shared/Feed.svelte b/src/app/shared/Feed.svelte index 7571bd51..48850c6f 100644 --- a/src/app/shared/Feed.svelte +++ b/src/app/shared/Feed.svelte @@ -101,12 +101,16 @@ notes = uniqBy(prop("id"), notes.concat(bottom)) } + let p = Promise.resolve() + const loadMore = async () => { // Wait for this page to load before trying again await network.load({ relays: feedRelay ? [feedRelay] : relays, filter: mergeFilter(filter, cursor.getFilter()), - onChunk, + onChunk: chunk => { + p = p.then(() => onChunk(chunk)) + }, }) // Update our cursor @@ -117,7 +121,9 @@ const sub = network.listen({ relays, filter: mergeFilter(filter, {since}), - onChunk, + onChunk: chunk => { + p = p.then(() => onChunk(chunk)) + }, }) const scroller = createScroller(loadMore, {element: getModal()}) diff --git a/src/app/state.ts b/src/app/state.ts index ca39d873..8ffc0a6a 100644 --- a/src/app/state.ts +++ b/src/app/state.ts @@ -178,7 +178,7 @@ export const listen = async pubkey => { ;(listen as any)._listener?.unsub() ;(listen as any)._listener = await network.listen({ - delay: 5000, + delay: 3000, relays: getUserReadRelays(), filter: [ {kinds: [1, 4], authors: [pubkey], since}, diff --git a/src/app/views/ListSelect.svelte b/src/app/views/ListSelect.svelte index 312cfa1e..16e3fca6 100644 --- a/src/app/views/ListSelect.svelte +++ b/src/app/views/ListSelect.svelte @@ -14,7 +14,7 @@ const {lists} = user const label = item.type === "p" ? "person" : "topic" - const modifyList = updateIn("tags", tags => tags.concat([[item.type, item.value]])) + const modifyList = updateIn("tags", tags => (tags || []).concat([[item.type, item.value]])) const selectlist = list => { modal.replace({type: "list/edit", list: modifyList(list)}) diff --git a/src/partials/state.ts b/src/partials/state.ts index 700fe9d2..5c197223 100644 --- a/src/partials/state.ts +++ b/src/partials/state.ts @@ -48,7 +48,7 @@ export const openModals = writable(0) export const modal = { stack: new WritableList([]) as WritableList, - sync: ($stack, opts = null) => { + sync: ($stack, opts = {}) => { const hash = $stack.length > 0 ? `#m=${$stack.length}` : "" navigate(window.location.pathname + hash, opts)