From b8af3f8147ea39a42f48b4450a6ec50b56295f88 Mon Sep 17 00:00:00 2001 From: Graham Steffaniak Date: Sun, 30 Jul 2023 17:35:30 -0500 Subject: [PATCH] fixed search bug --- backend/search/conditions.go | 8 +++++--- frontend/package.json | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/search/conditions.go b/backend/search/conditions.go index e9d5e977..c31a7a24 100644 --- a/backend/search/conditions.go +++ b/backend/search/conditions.go @@ -26,9 +26,9 @@ var compressedFile = []string{ } type searchOptions struct { - Conditions map[string]bool + Conditions map[string]bool Size int - Terms []string + Terms []string } func ParseSearch(value string) *searchOptions { @@ -59,6 +59,7 @@ func ParseSearch(value string) *searchOptions { case "folder" : opts.Conditions["dir"] = true case "file" : opts.Conditions["dir"] = false } + if len(filter) < 8 { continue } @@ -90,7 +91,8 @@ func ParseSearch(value string) *searchOptions { opts.Terms = []string{unique} return opts } - + re := regexp.MustCompile(` +`) + value = re.ReplaceAllString(value, " ") opts.Terms = strings.Split(value, " ") return opts } diff --git a/frontend/package.json b/frontend/package.json index 3c082566..2d954b88 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,8 +9,6 @@ "watch": "find ./dist -maxdepth 1 -mindepth 1 ! -name '.gitignore' -exec rm -r {} + && vue-cli-service build --watch --no-clean" }, "dependencies": { - "normalize.css": "^8.0.1", - "file-loader": "^6.2.0", "ace-builds": "^1.4.7", "clipboard": "^2.0.4", "css-vars-ponyfill": "^2.4.3",