Skip to content

Commit

Permalink
fix(markdown-theme): cannot switch themes
Browse files Browse the repository at this point in the history
  • Loading branch information
yikoyu committed Apr 24, 2024
1 parent 7e3ead5 commit 3623106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extensions/markdown-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ActionMenuButton from './components/ActionMenuButton.vue'

import type { MarkdownThemeProps } from '@/constants/define'
import { DEFAULT_MARKDOWN_THEME_LIST } from '@/constants/define'
import { useTiptapStore } from '@/hooks'
import { useContext } from '@/hooks'
import type { GeneralOptions } from '@/type'

/**
Expand All @@ -28,7 +28,7 @@ export const MarkdownTheme = /* @__PURE__*/ Extension.create<MarkdownThemeOption
...this.parent?.(),
markdownThemes: DEFAULT_MARKDOWN_THEME_LIST,
button: ({ editor, extension, t }) => {
const { state } = useTiptapStore()!
const { state } = useContext()

const markdownThemes =
([...DEFAULT_MARKDOWN_THEME_LIST, ...extension.options.markdownThemes] as MarkdownThemeProps[]) || []
Expand Down

0 comments on commit 3623106

Please sign in to comment.