From 2b9e66383160fc41f8c292ecb2f2ff7dfdd20a6b Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Thu, 14 Jan 2021 15:00:12 +0500 Subject: [PATCH] fix: adding tag with a # adds an extra # --- .../ActionSheetComponent/ActionSheetTagsSection.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js b/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js index ded06a07c..feb99ce08 100644 --- a/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js +++ b/apps/mobile/src/components/ActionSheetComponent/ActionSheetTagsSection.js @@ -47,6 +47,10 @@ export const ActionSheetTagsSection = ({item, close}) => { return; } + if (tagToAdd.startsWith("#")) { + tagToAdd = tagToAdd.slice(1); + } + let tag = tagToAdd; tag = tag.trim(); if (tag.includes(' ')) { @@ -124,7 +128,7 @@ export const ActionSheetTagsSection = ({item, close}) => { let _tags = db.tags.all; prevQuery = query; let _suggestions; - + if (query) { _suggestions = _tags.filter( (t) =>