Skip to content

Commit

Permalink
Merge pull request #10 from 0xdevant/fix/issue-when-input-on-search-box
Browse files Browse the repository at this point in the history
fix: update empty project link checking to fix search box input issue
  • Loading branch information
MufCZ authored Jun 27, 2024
2 parents f175e2a + 26f613e commit 68f73dc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions composables/useData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ export const useData = defineStore('data', () => {
const projectToShallow = (project: Project): ProjectShallow => {
const availableSupport = () => {
const filteredKeys = ['forum', 'discord', 'twitter', 'lens', 'farcaster', 'telegram']
if (typeof project.links === 'object' && (project.links !== null || project.links !== undefined))
return Object.keys(project.links).filter(key => filteredKeys.includes(key)).length
// if (typeof project.links === 'object' && (project.links !== null || project.links !== undefined))
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 {
Expand Down Expand Up @@ -96,8 +98,8 @@ export const useData = defineStore('data', () => {
.filter((project) => {
return (
project
&& project.title1
&& project.title1.toLowerCase().includes(query)
&& project.title1
&& project.title1.toLowerCase().includes(query)
)
}).filter((project) => {
if (filter.sortby === 'anonymity')
Expand Down

0 comments on commit 68f73dc

Please sign in to comment.