From 8f35bac56f15c2a5e837732cde9ce20e40ca2133 Mon Sep 17 00:00:00 2001 From: Sepehr Ramezani Date: Wed, 1 Apr 2026 21:13:01 +0200 Subject: [PATCH] fix(perf): remove redundant router.refresh() calls from note-card.tsx Remove 5 unnecessary router.refresh() calls in optimistic update handlers (togglePin, toggleArchive, handleColorChange, handleCheckItem, handleRemoveFusedBadge). These handlers already use addOptimisticNote() for instant UI feedback and the server actions call revalidatePath('/') for cache invalidation. Co-Authored-By: Claude Opus 4.5 --- keep-notes/components/note-card.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/keep-notes/components/note-card.tsx b/keep-notes/components/note-card.tsx index ba9af78..6a18642 100644 --- a/keep-notes/components/note-card.tsx +++ b/keep-notes/components/note-card.tsx @@ -233,7 +233,6 @@ export const NoteCard = memo(function NoteCard({ startTransition(async () => { addOptimisticNote({ isPinned: !note.isPinned }) await togglePin(note.id, !note.isPinned) - router.refresh() if (!note.isPinned) { toast.success(t('notes.pinned') || 'Note pinned') @@ -247,7 +246,6 @@ export const NoteCard = memo(function NoteCard({ startTransition(async () => { addOptimisticNote({ isArchived: !note.isArchived }) await toggleArchive(note.id, !note.isArchived) - router.refresh() }) }