[READ-ONLY] Mirror of https://github.com/flo-bit/atmo-tools. atmo.tools
0

Configure Feed

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

update from cursor

Florian (May 16, 2025, 12:25 PM +0200) e257366f 2324ceb7

+19 -5
+19 -5
src/routes/Search.svelte
··· 100 100 let cursor = undefined; 101 101 let response = undefined; 102 102 let found = false; 103 - let limit = 10; 103 + let limit = 100; 104 104 do { 105 105 try { 106 106 response = await client.rpc.request({ ··· 127 127 if (likesIds.has(like.post.uri)) { 128 128 found = true; 129 129 console.log('found like in local db, stopping getting more likes'); 130 - break; 131 - } 132 130 133 - addLikeId(like.post.uri); 131 + cursor = localStorage.getItem('cursor'); 132 + 133 + if (cursor) { 134 + console.log('cursor found in local storage, getting more likes starting from cursor'); 135 + localStorage.removeItem('cursor'); 136 + 137 + found = false; 138 + } 139 + 140 + break; 141 + } else { 142 + addLikeId(like.post.uri); 143 + } 134 144 } 135 145 136 - limit = 100; 146 + if (cursor && response?.data.feed.length > 0) { 147 + localStorage.setItem('cursor', cursor); 148 + } else { 149 + localStorage.removeItem('cursor'); 150 + } 137 151 } while (cursor && response?.data.feed.length > 0 && !found); 138 152 139 153 for (let like of all) {