Merge pull request #10 from 0xdevant/fix/issue-when-input-on-search-box

fix: update empty project link checking to fix search box input issue
This commit is contained in:
MufCZ 2024-06-27 14:59:16 +02:00 committed by GitHub
commit 68f73dc19d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -45,10 +45,12 @@ export const useData = defineStore('data', () => {
const projectToShallow = (project: Project): ProjectShallow => { const projectToShallow = (project: Project): ProjectShallow => {
const availableSupport = () => { const availableSupport = () => {
const filteredKeys = ['forum', 'discord', 'twitter', 'lens', 'farcaster', 'telegram'] const filteredKeys = ['forum', 'discord', 'twitter', 'lens', 'farcaster', 'telegram']
if (typeof project.links === 'object' && (project.links !== null || project.links !== undefined)) // if (typeof project.links === 'object' && (project.links !== null || project.links !== undefined))
return Object.keys(project.links).filter(key => filteredKeys.includes(key)).length if (project.links === null || project.links === undefined)
return 0 return 0
if (typeof project.links === 'object' && Object.keys(project.links).length > 0)
return Object.keys(project.links).filter(key => filteredKeys.includes(key)).length
} }
return { return {