mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Standardise naming of openDocId as openDocWithId or currentDocumentId (#23307)
GitOrigin-RevId: d71b6d878188c7b916f02a3749976ecd96d648a3
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
export const useIncludedFile = (argumentType: string) => {
|
||||
const state = useCodeMirrorStateContext()
|
||||
const { findEntityByPath } = useFileTreePathContext()
|
||||
const { openDocId } = useEditorManagerContext()
|
||||
const { openDocWithId } = useEditorManagerContext()
|
||||
|
||||
const openIncludedFile = useCallback(() => {
|
||||
const name = readIncludedPath(state, argumentType)
|
||||
@@ -21,12 +21,12 @@ export const useIncludedFile = (argumentType: string) => {
|
||||
for (const extension of ['.tex', '']) {
|
||||
const result = findEntityByPath(`${name}${extension}`)
|
||||
if (result) {
|
||||
return openDocId(result.entity._id)
|
||||
return openDocWithId(result.entity._id)
|
||||
}
|
||||
}
|
||||
// TODO: handle file not found
|
||||
}
|
||||
}, [argumentType, findEntityByPath, openDocId, state])
|
||||
}, [argumentType, findEntityByPath, openDocWithId, state])
|
||||
|
||||
return { openIncludedFile }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user