Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
arkin0x committed Nov 1, 2023
1 parent 21627c9 commit 3e471b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import { Publish } from './Publish'
import { useNavigate } from 'react-router-dom'

const isTest = (game: NDKEvent) => {
const findTest = game.tags.find((tag: string[]) => tag[0] === 'subject')![1].toLowerCase().includes('test') || game.content.includes('test')
return !!findTest
try {
const findTest = game.tags.find((tag: string[]) => tag[0] === 'subject')![1].toLowerCase().includes('test') || game.content.includes('test')
return !!findTest
} catch (e) {
// invalid tag. Not sure. Show it.
return false
}
}

export const Home = () => {
Expand Down

0 comments on commit 3e471b2

Please sign in to comment.