fix: check for valid url to pass to web component

This commit is contained in:
Cory Dransfeldt 2024-03-16 20:41:01 -07:00
parent e6dab2a329
commit d3ccfe17e0
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -108,7 +108,7 @@ export default {
// links
findPost: (url, posts) => {
if (!url || !posts) return null;
if (!url || !posts || !posts[url]?.toots?.[0]?.includes('https')) return null;
const BASE_URL = 'https://social.lol/users/cory/statuses/'
const STATUS_URL = 'https://social.lol/@cory/'
return posts[url]?.toots?.[0]?.replace(BASE_URL, STATUS_URL) || null;