mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-04 00:48:51 -04:00
Move toolbar functions into redux reducer (#1763)
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
a6a2251c88
commit
b30cc5b390
80 changed files with 2481 additions and 2303 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
import React, { useCallback } from 'react'
|
||||
import sanitize from 'sanitize-filename'
|
||||
import { store } from '../../../../redux'
|
||||
import { getGlobalState } from '../../../../redux'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { download } from '../../../common/download/download'
|
||||
import { SidebarButton } from '../sidebar-button/sidebar-button'
|
||||
|
@ -17,7 +17,7 @@ export const ExportMarkdownSidebarEntry: React.FC = () => {
|
|||
const { t } = useTranslation()
|
||||
const markdownContent = useNoteMarkdownContent()
|
||||
const onClick = useCallback(() => {
|
||||
const sanitized = sanitize(store.getState().noteDetails.noteTitle)
|
||||
const sanitized = sanitize(getGlobalState().noteDetails.noteTitle)
|
||||
download(markdownContent, `${sanitized !== '' ? sanitized : t('editor.untitledNote')}.md`, 'text/markdown')
|
||||
}, [markdownContent, t])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue