From 9afd224a231ad58c9ee1dddd10d9ab23b90312b2 Mon Sep 17 00:00:00 2001 From: abhinav-grd Date: Thu, 7 Oct 2021 11:17:22 +0530 Subject: [PATCH] dont show shared files in options --- src/services/searchService.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/searchService.ts b/src/services/searchService.ts index d90cfddf2..d24e2d239 100644 --- a/src/services/searchService.ts +++ b/src/services/searchService.ts @@ -5,6 +5,8 @@ import { DateValue, Suggestion, SuggestionType } from 'components/SearchBar'; import HTTPService from './HTTPService'; import { Collection } from './collectionService'; import { File } from './fileService'; +import { User } from './userService'; +import { getData, LS_KEYS } from 'utils/storage/localStorage'; const ENDPOINT = getEndpoint(); const DIGITS = new Set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']); @@ -113,7 +115,9 @@ export function searchCollection( } export function searchFiles(searchPhrase: string, files: File[]) { + const user: User = getData(LS_KEYS.USER) ?? {}; return files + .filter((file) => file.ownerID === user.id) .map((file, idx) => ({ title: file.metadata.title, index: idx,