perf: memo GridCard, fuse save fns, fix slash tab active color
This commit is contained in:
@@ -557,6 +557,15 @@ export function HomeClient({
|
||||
emitNoteChange({ type: 'updated', note: fresh })
|
||||
}, [patchNoteInList])
|
||||
|
||||
const handleNoteIllustrationDeleted = useCallback((noteId: string) => {
|
||||
patchNoteInList(noteId, { illustrationSvg: null })
|
||||
setNotes((prev) => {
|
||||
const updated = prev.find((n) => n.id === noteId)
|
||||
if (updated) emitNoteChange({ type: 'updated', note: { ...updated, illustrationSvg: null } })
|
||||
return prev
|
||||
})
|
||||
}, [patchNoteInList])
|
||||
|
||||
const handleGridReorder = useCallback(
|
||||
async (orderedIds: string[]) => {
|
||||
setSortOrder('manual')
|
||||
@@ -1174,6 +1183,7 @@ export function HomeClient({
|
||||
onMoveToNotebook={handleMoveNoteToNotebook}
|
||||
onNotePatch={handleNoteContentPatch}
|
||||
onNoteIllustrationGenerated={handleNoteIllustrationGenerated}
|
||||
onNoteIllustrationDeleted={handleNoteIllustrationDeleted}
|
||||
onGridReorder={handleGridReorder}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user