Skip to content

Commit

Permalink
fix: duplicate emoji issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dgokcin committed Oct 29, 2024
1 parent d8490ca commit 607fdb6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 607fdb6

Please sign in to comment.