mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #22087 from overleaf/mj-index-on-wc-rm-entry
[web] Re-index references after adding a RM entry with Write and Cite GitOrigin-RevId: 6b2a93143486079dfc82af393e2c5621fed7a4ee
This commit is contained in:
committed by
Copybot
parent
7dffcbf645
commit
592e484098
@@ -16,6 +16,7 @@ import { useFileTreeData } from '@/shared/context/file-tree-data-context'
|
||||
import { findDocEntityById } from '@/features/ide-react/util/find-doc-entity-by-id'
|
||||
import { IdeEvents } from '@/features/ide-react/create-ide-event-emitter'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import useEventListener from '@/shared/hooks/use-event-listener'
|
||||
|
||||
export const ReferencesContext = createContext<
|
||||
| {
|
||||
@@ -100,6 +101,10 @@ export const ReferencesProvider: FC = ({ children }) => {
|
||||
}
|
||||
}, [eventEmitter, fileTreeData, indexReferencesIfDocModified])
|
||||
|
||||
useEventListener('reference:added', function () {
|
||||
indexAllReferences(true)
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
const handleProjectJoined = () => {
|
||||
// We only need to grab the references when the editor first loads,
|
||||
|
||||
Reference in New Issue
Block a user