From 1d6c0686016cdb53c36d8ca60de6429ea92bc691 Mon Sep 17 00:00:00 2001 From: daledah Date: Wed, 7 Aug 2024 21:33:34 +0700 Subject: [PATCH] fix: create expense with colon tag returns error --- src/libs/IOUUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/IOUUtils.ts b/src/libs/IOUUtils.ts index 5f6d99332336..986fd165d2d7 100644 --- a/src/libs/IOUUtils.ts +++ b/src/libs/IOUUtils.ts @@ -141,7 +141,10 @@ function insertTagIntoTransactionTagsString(transactionTags: string, tag: string const tagArray = TransactionUtils.getTagArrayFromName(transactionTags); tagArray[tagIndex] = tag; - return tagArray.join(CONST.COLON).replace(/:*$/, ''); + return tagArray + .map((tagItem) => tagItem.trim()) + .filter((tagItem) => !!tagItem) + .join(CONST.COLON); } function isMovingTransactionFromTrackExpense(action?: IOUAction) {