Changeset 544e9c2 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 07/19/2026 11:58:47 PM (7 weeks ago)
- Branches:
- main
- Children:
- 162c7a7
- Parents:
- 8ed65a6
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r8ed65a6 r544e9c2 2691 2691 } 2692 2692 } catch { /* ignore */ } 2693 // Your own polls that have closed → a "results are in" item, derived read-time 2694 // from poll_json (Scheduler marks closed=1) with the tally via ownPollView. 2695 try { 2696 const site = db.prepare('SELECT id FROM sites WHERE slug = ?').get(slug); 2697 if (site) { 2698 const polls = db.prepare(` 2699 SELECT id, slug, title, poll_json FROM posts 2700 WHERE site_id = ? AND poll_json IS NOT NULL 2701 AND json_extract(poll_json, '$.closed') = 1 2702 AND json_extract(poll_json, '$.endTime') IS NOT NULL 2703 ORDER BY json_extract(poll_json, '$.endTime') DESC LIMIT 20`).all(site.id); 2704 for (const p of polls) { 2705 const view = ownPollView(p); 2706 if (!view) continue; 2707 let endTime = null; try { endTime = JSON.parse(p.poll_json).endTime; } catch { /* keep null */ } 2708 out.push({ type: 'poll_done', post_slug: p.slug, post_title: p.title, poll: view, created_at: endTime || null }); 2709 } 2710 } 2711 } catch { /* ignore */ } 2693 2712 // NaN-safe sort: one row with a missing/garbled created_at would otherwise make the 2694 2713 // comparator return NaN and scramble the WHOLE ordering (seen live: follow rows landing
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)