Skip to content

Commit

Permalink
fix: do not change work calendar color when modifying reclaim events
Browse files Browse the repository at this point in the history
  • Loading branch information
dgokcin committed Nov 3, 2024
1 parent d3bce95 commit 8f073ed
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,19 @@ function ColorEvents() {
var isReclaim = false

// Check for Reclaim events
if (title === '🤝 Meeting' && d.includes('Reclaim')) {
isReclaim = true
if ((title === '🤝 Meeting' && d.includes('Reclaim')) ||
(title === '🤝 meeting' && d.includes('This event was originally created by Reclaim'))) {
isReclaim = true;
if (!isDevelopment) {
Logger.log("Reclaim event found: " + title + " on date: " + e.getStartTime());
newTitle = "🤝 meeting";
e.setTitle(newTitle);
Logger.log("Reclaim event title modified to: " + newTitle);
e.setDescription("This event was originally created by Reclaim");
e.setVisibility(CalendarApp.Visibility.PRIVATE);
Logger.log("Reclaim event modified to private.");
}
continue;
}

// Check for matching event types and add emojis
Expand Down Expand Up @@ -164,12 +175,6 @@ function ColorEvents() {
}
}
// Handling the isReclaim condition
if (isReclaim) {
e.setTitle("🤝 meeting");
e.setDescription("This event has been modified.");
e.setVisibility(CalendarApp.Visibility.PRIVATE);
Logger.log("Reclaim event modified to private.");
}
}
} catch (error) {
Logger.log("Error updating event: " + error.toString() + " - Title: " + originalTitle);
Expand Down

0 comments on commit 8f073ed

Please sign in to comment.