From 607fdb67443086c2d27c7309d6aba0771082c22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20G=C3=B6k=C3=A7in?= Date: Tue, 29 Oct 2024 12:25:21 +0100 Subject: [PATCH] fix: duplicate emoji issue --- Code.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Code.js b/Code.js index 37260cb..a4cd921 100644 --- a/Code.js +++ b/Code.js @@ -64,11 +64,15 @@ function ColorEvents() { // Check for Reclaim events if (title === '🤝 Meeting' && d.includes('Reclaim')) { - console.log("reclaim event found") - title = '🤝 busy'; + console.log("reclaim event found"); + // Ensure no emoji is prepended if one already exists + if (!/^[\p{Emoji}]/u.test(title)) { + title = '🤝 ' + title; + } else { + title = '🤝 busy'; // Update to just '🤝 busy' if emoji already present + } } - // Check for matching event types and add emojis for (const [key, emoji] of Object.entries(emojiMap)) { const regex = new RegExp(key, 'i'); // Case-insensitive match