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:
Matthieu MALVACHE
2026-02-22 18:07:30 +01:00
committed by Matthieu MALVACHE
parent 838ee4b8e5
commit 15c14b1833
5 changed files with 533 additions and 430 deletions
+23 -6
View File
@@ -1060,8 +1060,10 @@ export const useEmailStore = create<EmailStore>((set, get) => ({
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
const currentFirstEmailId = get().emails[0]?.id;
const currentFirstEmailId = currentEmails[0]?.id;
const newFirstEmailId = result.emails[0]?.id;
// 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]);
}
set({
emails: result.emails,
hasMoreEmails: result.hasMore,
totalEmails: result.total
});
// Skip state update if emails haven't actually changed to avoid
// unnecessary re-renders that cause a visible list flicker
const hasChanged =
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) {
console.error('Failed to refresh current mailbox:', error);
// Don't set error state for background refreshes to avoid disrupting the UI