From 937c38def709bbd94ecb0ae25c2f1ac41ab5558e Mon Sep 17 00:00:00 2001 From: Chris <cdietschrunfast@gmail.com> Date: Mon, 1 Jan 2024 21:47:39 +1300 Subject: [PATCH] fix lint --- .github/workflows/main_goodplays.yml | 4 ++-- client/src/components/GameSessionList.tsx | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main_goodplays.yml b/.github/workflows/main_goodplays.yml index f30bafd..de482cc 100644 --- a/.github/workflows/main_goodplays.yml +++ b/.github/workflows/main_goodplays.yml @@ -19,9 +19,9 @@ jobs: - uses: actions/checkout@v4.1.1 - name: Set up Node.js version - uses: actions/setup-node@v3.8.1 + uses: actions/setup-node@v4.0.1 with: - node-version: '18.x' + node-version: '20.x' - name: npm install, build, and test run: | diff --git a/client/src/components/GameSessionList.tsx b/client/src/components/GameSessionList.tsx index 330bc03..f26e453 100644 --- a/client/src/components/GameSessionList.tsx +++ b/client/src/components/GameSessionList.tsx @@ -16,13 +16,15 @@ const GameSessionList: React.FC = () => { const [search, setSearch] = useState(""); const [searchResults, setSearchResults] = useState(gameSessions); - const fuseOptions = { - keys: ['gameName'], - includeScore: true, - threshold: 0.3, - }; - const fuse = new Fuse(gameSessions, fuseOptions); + useEffect(() => { + const fuseOptions = { + keys: ['gameName'], + includeScore: true, + threshold: 0.3, + }; + const fuse = new Fuse(gameSessions, fuseOptions); + if (search === '') { setSearchResults(gameSessions); } else {