fix: 🐛
This commit is contained in:
parent
9f6045461c
commit
36959a1052
2 changed files with 6 additions and 2 deletions
|
|
@ -93,6 +93,8 @@ const NoteList = forwardRef<
|
|||
const [refreshCount, setRefreshCount] = useState(0)
|
||||
const supportTouch = useMemo(() => isTouchDevice(), [])
|
||||
const topRef = useRef<HTMLDivElement | null>(null)
|
||||
const showNewNotesDirectlyRef = useRef(showNewNotesDirectly)
|
||||
showNewNotesDirectlyRef.current = showNewNotesDirectly
|
||||
|
||||
const shouldHideEvent = useCallback(
|
||||
(evt: Event) => {
|
||||
|
|
@ -331,7 +333,7 @@ const NoteList = forwardRef<
|
|||
}
|
||||
},
|
||||
onNew: (event) => {
|
||||
if (showNewNotesDirectly) {
|
||||
if (showNewNotesDirectlyRef.current) {
|
||||
setEvents((oldEvents) =>
|
||||
oldEvents.some((e) => e.id === event.id) ? oldEvents : [event, ...oldEvents]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue