chore: update dependencies and fix calendar event hooks
Bump tailwindcss 4.2.0, lucide-react 0.575.0, @typescript-eslint 8.56.0, tailwind-merge 3.5.0, and patch-level updates across 48 transitive packages. Fix missing useCallback dependency in calendar event card.
This commit is contained in:
@@ -84,7 +84,7 @@ export function EventCard({ event, calendar, variant, onClick, isSelected, dragg
|
|||||||
e.dataTransfer.setDragImage(preview, 0, 0);
|
e.dataTransfer.setDragImage(preview, 0, 0);
|
||||||
requestAnimationFrame(() => preview.remove());
|
requestAnimationFrame(() => preview.remove());
|
||||||
setIsBeingDragged(true);
|
setIsBeingDragged(true);
|
||||||
}, [event, color, t, durationMinutes]);
|
}, [event, color, t, durationMinutes, timeString]);
|
||||||
|
|
||||||
const handleDragEnd = useCallback(() => {
|
const handleDragEnd = useCallback(() => {
|
||||||
setIsBeingDragged(false);
|
setIsBeingDragged(false);
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ export function EventModal({
|
|||||||
relativeTo: null,
|
relativeTo: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
} else if (isEdit && event?.locations && Object.keys(event.locations).length > 0) {
|
} else if (event && event.locations && Object.keys(event.locations).length > 0) {
|
||||||
data.locations = null;
|
data.locations = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@ export function EventModal({
|
|||||||
count: null,
|
count: null,
|
||||||
until: null,
|
until: null,
|
||||||
}];
|
}];
|
||||||
} else if (isEdit && event?.recurrenceRules?.length) {
|
} else if (event && event.recurrenceRules?.length) {
|
||||||
data.recurrenceRules = null;
|
data.recurrenceRules = null;
|
||||||
if (event.recurrenceOverrides) data.recurrenceOverrides = null;
|
if (event.recurrenceOverrides) data.recurrenceOverrides = null;
|
||||||
if (event.excludedRecurrenceRules) data.excludedRecurrenceRules = null;
|
if (event.excludedRecurrenceRules) data.excludedRecurrenceRules = null;
|
||||||
@@ -278,7 +278,7 @@ export function EventModal({
|
|||||||
relatedTo: null,
|
relatedTo: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
} else if (isEdit && event?.alerts && Object.keys(event.alerts).length > 0) {
|
} else if (event && event.alerts && Object.keys(event.alerts).length > 0) {
|
||||||
data.alerts = null;
|
data.alerts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
+505
-419
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -37,7 +37,7 @@
|
|||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"dompurify": "^3.3.1",
|
"dompurify": "^3.3.1",
|
||||||
"jmap-jam": "^0.13.1",
|
"jmap-jam": "^0.13.1",
|
||||||
"lucide-react": "^0.564.0",
|
"lucide-react": "^0.575.0",
|
||||||
"next": "^16.1.5",
|
"next": "^16.1.5",
|
||||||
"next-intl": "^4.5.8",
|
"next-intl": "^4.5.8",
|
||||||
"react": "^19.2.1",
|
"react": "^19.2.1",
|
||||||
|
|||||||
+23
-6
@@ -1060,8 +1060,10 @@ export const useEmailStore = create<EmailStore>((set, get) => ({
|
|||||||
|
|
||||||
const result = await client.getEmails(jmapMailboxId, accountId, emailsPerPage, 0);
|
const result = await client.getEmails(jmapMailboxId, accountId, emailsPerPage, 0);
|
||||||
|
|
||||||
|
const currentEmails = get().emails;
|
||||||
|
|
||||||
// Check if there are new emails by comparing the first email ID
|
// Check if there are new emails by comparing the first email ID
|
||||||
const currentFirstEmailId = get().emails[0]?.id;
|
const currentFirstEmailId = currentEmails[0]?.id;
|
||||||
const newFirstEmailId = result.emails[0]?.id;
|
const newFirstEmailId = result.emails[0]?.id;
|
||||||
|
|
||||||
// If the first email changed, we have a new email - trigger notification
|
// If the first email changed, we have a new email - trigger notification
|
||||||
@@ -1069,11 +1071,26 @@ export const useEmailStore = create<EmailStore>((set, get) => ({
|
|||||||
get().handleNewEmailNotification(result.emails[0]);
|
get().handleNewEmailNotification(result.emails[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
set({
|
// Skip state update if emails haven't actually changed to avoid
|
||||||
emails: result.emails,
|
// unnecessary re-renders that cause a visible list flicker
|
||||||
hasMoreEmails: result.hasMore,
|
const hasChanged =
|
||||||
totalEmails: result.total
|
currentEmails.length !== result.emails.length ||
|
||||||
});
|
result.emails.some((email, i) => {
|
||||||
|
const curr = currentEmails[i];
|
||||||
|
return (
|
||||||
|
curr.id !== email.id ||
|
||||||
|
curr.threadId !== email.threadId ||
|
||||||
|
JSON.stringify(curr.keywords) !== JSON.stringify(email.keywords)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (hasChanged) {
|
||||||
|
set({
|
||||||
|
emails: result.emails,
|
||||||
|
hasMoreEmails: result.hasMore,
|
||||||
|
totalEmails: result.total,
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to refresh current mailbox:', error);
|
console.error('Failed to refresh current mailbox:', error);
|
||||||
// Don't set error state for background refreshes to avoid disrupting the UI
|
// Don't set error state for background refreshes to avoid disrupting the UI
|
||||||
|
|||||||
Reference in New Issue
Block a user