a tool for shared writing and social publishing
0
fork

Configure Feed

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

tweak card focusing logic

+11 -8
+11 -8
components/Cards.tsx
··· 228 228 })); 229 229 230 230 setTimeout(async () => { 231 + //scroll to card 232 + document.getElementById(elementId.card(cardID).container)?.scrollIntoView({ 233 + behavior: "smooth", 234 + inline: "nearest", 235 + }); 236 + 231 237 // if we asked that the function focus the first block, do that 238 + 232 239 if (focusFirstBlock === "focusFirstBlock") { 233 240 let firstBlock = await rep.query(async (tx) => { 234 241 let blocks = await tx ··· 264 271 }); 265 272 266 273 if (firstBlock) { 267 - focusBlock(firstBlock, { type: "start" }); 274 + setTimeout(() => { 275 + focusBlock(firstBlock, { type: "start" }); 276 + }, 500); 268 277 } 269 278 } 270 - 271 - //scroll to card 272 - document.getElementById(elementId.card(cardID).container)?.scrollIntoView({ 273 - behavior: "smooth", 274 - inline: "nearest", 275 - }); 276 - }, 100); 279 + }, 50); 277 280 } 278 281 279 282 const blurCard = () => {