this repo has no description
0
fork

Configure Feed

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

Prioritise local instance unfurl over remote

+12 -3
+12 -3
src/components/status.jsx
··· 2364 2364 } 2365 2365 2366 2366 if (remoteInstanceFetch) { 2367 - return Promise.any([remoteInstanceFetch, mastoSearchFetch]) 2368 - .then(handleFulfill) 2369 - .catch(handleCatch); 2367 + // return Promise.any([remoteInstanceFetch, mastoSearchFetch]) 2368 + // .then(handleFulfill) 2369 + // .catch(handleCatch); 2370 + // If mastoSearchFetch is fulfilled within 3s, return it, else return remoteInstanceFetch 2371 + const finalPromise = Promise.race([ 2372 + mastoSearchFetch, 2373 + new Promise((resolve, reject) => setTimeout(reject, 3000)), 2374 + ]).catch(() => { 2375 + // If remoteInstanceFetch is fullfilled, return it, else return mastoSearchFetch 2376 + return remoteInstanceFetch.catch(() => mastoSearchFetch); 2377 + }); 2378 + return finalPromise.then(handleFulfill).catch(handleCatch); 2370 2379 } else { 2371 2380 return mastoSearchFetch.then(handleFulfill).catch(handleCatch); 2372 2381 }