this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Auto-threadify when open a status page with context

+7 -2
+6 -1
src/pages/status.jsx
··· 14 14 import Status from '../components/status'; 15 15 import htmlContentLength from '../utils/html-content-length'; 16 16 import shortenNumber from '../utils/shorten-number'; 17 - import states, { saveStatus } from '../utils/states'; 17 + import states, { saveStatus, threadifyStatus } from '../utils/states'; 18 18 import store from '../utils/store'; 19 19 import { getCurrentAccount } from '../utils/store-utils'; 20 20 import useDebouncedCallback from '../utils/useDebouncedCallback'; ··· 160 160 console.log({ allStatuses }); 161 161 setStatuses(allStatuses); 162 162 cachedStatusesMap.current[id] = allStatuses; 163 + 164 + // Let's threadify this one 165 + // Note that all non-hero statuses will trigger saveStatus which will threadify them too 166 + // By right, at this point, all descendant statuses should be cached 167 + threadifyStatus(heroStatus); 163 168 } catch (e) { 164 169 console.error(e); 165 170 setUIState('error');
+1 -1
src/utils/states.js
··· 45 45 } 46 46 } 47 47 48 - function threadifyStatus(status) { 48 + export function threadifyStatus(status) { 49 49 // Return all statuses in the thread, via inReplyToId, if inReplyToAccountId === account.id 50 50 let fetchIndex = 0; 51 51 async function traverse(status, index = 0) {