fix: allow timeline summary for anonymous user
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { convertLexicalToMarkdown } from "@follow/components/ui/lexical-rich-editor/utils.js"
|
||||
import { DEFAULT_SUMMARIZE_TIMELINE_SHORTCUT_ID } from "@follow/shared/settings/defaults"
|
||||
import type { AIShortcut } from "@follow/shared/settings/interface"
|
||||
import { getCategoryFeedIds } from "@follow/store/subscription/getter"
|
||||
import type { EditorState } from "lexical"
|
||||
@@ -144,7 +145,8 @@ export const useSendAIShortcut = () => {
|
||||
|
||||
const sendShortcutMessage = useCallback(
|
||||
(editorState: EditorState, shortcutId?: string) => {
|
||||
if (!ensureLogin()) {
|
||||
const isTimelineSummaryShortcut = shortcutId === DEFAULT_SUMMARIZE_TIMELINE_SHORTCUT_ID
|
||||
if (!isTimelineSummaryShortcut && !ensureLogin()) {
|
||||
return
|
||||
}
|
||||
const contextBlocks = buildContextBlocks()
|
||||
@@ -171,7 +173,16 @@ export const useSendAIShortcut = () => {
|
||||
id: prefixMessageIdWithShortcut(nanoid(), shortcutId),
|
||||
}
|
||||
|
||||
void chatActions.sendMessage(message)
|
||||
void chatActions.sendMessage(
|
||||
message,
|
||||
isTimelineSummaryShortcut
|
||||
? {
|
||||
body: {
|
||||
scene: "timeline-summary",
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
)
|
||||
},
|
||||
[buildContextBlocks, chatActions, ensureLogin, staticEditor],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user