mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
fix: remove redundant note detail props
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
cdfcd325a1
commit
77f858bff8
13 changed files with 12 additions and 49 deletions
|
@ -45,7 +45,7 @@ export const useOnImageUploadFromRenderer = (): void => {
|
|||
const file = new File([blob], fileName, { type: blob.type })
|
||||
const { cursorSelection, alt, title } = Optional.ofNullable(lineIndex)
|
||||
.flatMap((actualLineIndex) => {
|
||||
const lineOffset = getGlobalState().noteDetails.frontmatterRendererInfo.lineOffset
|
||||
const lineOffset = getGlobalState().noteDetails.startOfContentLineOffset
|
||||
return findPlaceholderInMarkdownContent(actualLineIndex + lineOffset, placeholderIndexInLine)
|
||||
})
|
||||
.orElse({} as ExtractResult)
|
||||
|
|
|
@ -21,8 +21,7 @@ export const useOnScrollWithLineOffset = (onScroll: ScrollCallback | undefined):
|
|||
} else {
|
||||
return (scrollState: ScrollState) => {
|
||||
onScroll({
|
||||
firstLineInView:
|
||||
scrollState.firstLineInView + getGlobalState().noteDetails.frontmatterRendererInfo.lineOffset,
|
||||
firstLineInView: scrollState.firstLineInView + getGlobalState().noteDetails.startOfContentLineOffset,
|
||||
scrolledPercentage: scrollState.scrolledPercentage
|
||||
})
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import { useMemo } from 'react'
|
|||
* @return the adjusted scroll state without the line offset
|
||||
*/
|
||||
export const useScrollStateWithoutLineOffset = (scrollState: ScrollState | undefined): ScrollState | undefined => {
|
||||
const lineOffset = useApplicationState((state) => state.noteDetails.frontmatterRendererInfo.lineOffset)
|
||||
const lineOffset = useApplicationState((state) => state.noteDetails.startOfContentLineOffset)
|
||||
return useMemo(() => {
|
||||
return scrollState === undefined
|
||||
? undefined
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue