mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix(react/collections/geomap): react to icon & color changes
This commit is contained in:
		| @@ -168,14 +168,14 @@ function NoteWrapper({ note, isReadOnly }: { note: FNote, isReadOnly: boolean }) | |||||||
|  |  | ||||||
| function NoteMarker({ note, editable, latLng }: { note: FNote, editable: boolean, latLng: [number, number] }) { | function NoteMarker({ note, editable, latLng }: { note: FNote, editable: boolean, latLng: [number, number] }) { | ||||||
|     // React to changes |     // React to changes | ||||||
|     useNoteLabel(note, "color"); |     const [ color ] = useNoteLabel(note, "color"); | ||||||
|     useNoteLabel(note, "iconClass"); |     const [ iconClass ] = useNoteLabel(note, "iconClass"); | ||||||
|     const [ archived ] = useNoteLabelBoolean(note, "archived"); |     const [ archived ] = useNoteLabelBoolean(note, "archived"); | ||||||
|  |  | ||||||
|     const title = useNoteProperty(note, "title"); |     const title = useNoteProperty(note, "title"); | ||||||
|     const colorClass = note.getColorClass(); |     const icon = useMemo(() => { | ||||||
|     const iconClass = note.getIcon(); |         return buildIcon(note.getIcon(), note.getColorClass() ?? undefined, title, note.noteId, archived); | ||||||
|     const icon = useMemo(() => buildIcon(iconClass, colorClass ?? undefined, title, note.noteId, archived), [ iconClass, colorClass, title, note.noteId, archived]); |     }, [ iconClass, color, title, note.noteId, archived]); | ||||||
|  |  | ||||||
|     const onClick = useCallback(() => { |     const onClick = useCallback(() => { | ||||||
|         appContext.triggerCommand("openInPopup", { noteIdOrPath: note.noteId }); |         appContext.triggerCommand("openInPopup", { noteIdOrPath: note.noteId }); | ||||||
|   | |||||||
| @@ -50,7 +50,7 @@ export default function Marker({ coordinates, icon, draggable, onClick, onDragge | |||||||
|         newMarker.addTo(parentMap); |         newMarker.addTo(parentMap); | ||||||
|  |  | ||||||
|         return () => newMarker.removeFrom(parentMap); |         return () => newMarker.removeFrom(parentMap); | ||||||
|     }, [ parentMap, coordinates, onMouseDown, onDragged ]); |     }, [ parentMap, coordinates, onMouseDown, onDragged, icon ]); | ||||||
|  |  | ||||||
|     return (<div />) |     return (<div />) | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user