mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-27 13:34:28 -04:00
Move markdown split into redux (#1681)
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
71e668cd17
commit
6594e1bb86
30 changed files with 217 additions and 226 deletions
src/components/markdown-renderer/hooks
|
@ -27,7 +27,7 @@ const initialSlideState: SlideState = {
|
|||
indexVertical: 0
|
||||
}
|
||||
|
||||
export const useReveal = (content: string, slideOptions?: SlideOptions): REVEAL_STATUS => {
|
||||
export const useReveal = (markdownContentLines: string[], slideOptions?: SlideOptions): REVEAL_STATUS => {
|
||||
const [deck, setDeck] = useState<Reveal>()
|
||||
const [revealStatus, setRevealStatus] = useState<REVEAL_STATUS>(REVEAL_STATUS.NOT_INITIALISED)
|
||||
const currentSlideState = useRef<SlideState>(initialSlideState)
|
||||
|
@ -67,7 +67,7 @@ export const useReveal = (content: string, slideOptions?: SlideOptions): REVEAL_
|
|||
log.debug('Sync deck')
|
||||
deck.sync()
|
||||
deck.slide(currentSlideState.current.indexHorizontal, currentSlideState.current.indexVertical)
|
||||
}, [content, deck, revealStatus])
|
||||
}, [markdownContentLines, deck, revealStatus])
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue