fix(chat): 发送后切会话不再误标未读,管理端撤回实时同步到对话页
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
20
frontend/components/PostLinkProvider.tsx
Normal file
20
frontend/components/PostLinkProvider.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
const PostLinkCtx = createContext(true);
|
||||
|
||||
/** 帖内 Markdown 外链是否新标签打开(来自公开站点设置) */
|
||||
export default function PostLinkProvider({
|
||||
openInNewTab,
|
||||
children,
|
||||
}: {
|
||||
openInNewTab: boolean;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return <PostLinkCtx.Provider value={openInNewTab}>{children}</PostLinkCtx.Provider>;
|
||||
}
|
||||
|
||||
export function usePostLinkNewTab() {
|
||||
return useContext(PostLinkCtx);
|
||||
}
|
||||
Reference in New Issue
Block a user