From 9e43eba0924808abf24cda2240c17fdf956658a1 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 22 Dec 2022 11:32:58 +0800 Subject: [PATCH] lint --- modules/gui/src/components/NavBar/NavBar.svelte | 5 ----- .../gui/src/components/ProfileBanner/ProfileBanner.svelte | 4 ++-- .../gui/src/components/SearchResults/SearchResults.svelte | 1 - modules/gui/src/libs/stores.ts | 6 +++--- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/gui/src/components/NavBar/NavBar.svelte b/modules/gui/src/components/NavBar/NavBar.svelte index d50a78b..8c483e8 100644 --- a/modules/gui/src/components/NavBar/NavBar.svelte +++ b/modules/gui/src/components/NavBar/NavBar.svelte @@ -1,6 +1,5 @@ diff --git a/modules/gui/src/libs/stores.ts b/modules/gui/src/libs/stores.ts index b2480c7..2f37a49 100644 --- a/modules/gui/src/libs/stores.ts +++ b/modules/gui/src/libs/stores.ts @@ -22,7 +22,7 @@ export const initializePackages = async () => { function initPackagesStore() { let initialized = false; const { subscribe, set } = writable([]); - let packages: GUIPackage[] = []; + const packages: GUIPackage[] = []; let packagesIndex: Fuse; if (!initialized) { @@ -40,8 +40,8 @@ function initPackagesStore() { return { packages, subscribe, - search: async (term: string, limit: number = 5): Promise => { - if (!term) return []; + search: async (term: string, limit = 5): Promise => { + if (!term || !packagesIndex) return []; // TODO: if online, use algolia else use Fuse const res = packagesIndex.search(term, { limit });