Browse Source

bug-fix

imwald
Silberengel 1 month ago
parent
commit
3c6815216f
  1. 3
      src/components/PostEditor/PostTextarea/Mention/suggestion.ts
  2. 1
      src/services/post-editor-cache.service.ts

3
src/components/PostEditor/PostTextarea/Mention/suggestion.ts

@ -45,7 +45,7 @@ const suggestion = {
}: { }: {
editor: Editor editor: Editor
range: { from: number; to: number } range: { from: number; to: number }
props: { id: string; label?: string; mode?: PickerSearchMode } props: { id: string | null; label?: string | null; mode?: PickerSearchMode }
}) => { }) => {
if (props.id === NEVENT_NADDR_PICKER_ID) { if (props.id === NEVENT_NADDR_PICKER_ID) {
postEditor.closeSuggestionPopup() postEditor.closeSuggestionPopup()
@ -56,6 +56,7 @@ const suggestion = {
) )
return return
} }
if (props.id == null) return
const to = extendMentionRangeToEndOfWord(editor, range) const to = extendMentionRangeToEndOfWord(editor, range)
const nodeAfter = editor.view.state.selection.$to.nodeAfter const nodeAfter = editor.view.state.selection.$to.nodeAfter
const overrideSpace = nodeAfter?.text?.startsWith(' ') const overrideSpace = nodeAfter?.text?.startsWith(' ')

1
src/services/post-editor-cache.service.ts

@ -21,7 +21,6 @@ class PostEditorCacheService {
private postContentCache: Map<string, Content> = new Map() private postContentCache: Map<string, Content> = new Map()
private postSettingsCache: Map<string, TPostSettings> = new Map() private postSettingsCache: Map<string, TPostSettings> = new Map()
private static THREAD_DRAFT_KEY = 'create-thread'
private threadDraftCache: TThreadDraft | null = null private threadDraftCache: TThreadDraft | null = null
constructor() { constructor() {

Loading…
Cancel
Save