From 7e457446043c3fa46f3392bf06d8a82c9846ee8c Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Thu, 14 Jan 2021 14:57:42 +0500 Subject: [PATCH] do not show deleted tags in suggestions --- .../ActionSheetComponent/ActionSheetTagsSection.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js b/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js index 55f66d284..ded06a07c 100644 --- a/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js +++ b/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js @@ -121,15 +121,17 @@ export const ActionSheetTagsSection = ({item, close}) => { const getSuggestions = (query, note) => { if (!note || !note?.id) return; + let _tags = db.tags.all; prevQuery = query; let _suggestions; + if (query) { - _suggestions = tags.filter( + _suggestions = _tags.filter( (t) => t.title.startsWith(query) && !note.tags.find((n) => n === t.title), ); } else { - _suggestions = tags + _suggestions = _tags .slice() .sort(function (x, y) { return x.dateEdited - y.dateEdited;