refactor(core): introduce EventBus and refactor store infrastructure
- Add EventBus for decoupled event-driven communication between services - Add EventSubscriber component for centralized event handling - Add requestDedupe utility for shared request deduplication - Refactor api/wsService to use eventBus instead of direct router navigation - Extract MessageMapper.toCachedMessages for consistent message mapping - Remove deprecated BaseManager and CacheBus classes - Improve @mention rendering with memberMap support in segment rendering - Update hooks to use useRef instead of useState for fetch tracking
This commit is contained in:
@@ -34,6 +34,8 @@ export const LongPressMenu: React.FC<LongPressMenuProps> = ({
|
||||
onRecall,
|
||||
onDelete,
|
||||
onAddSticker,
|
||||
onReport,
|
||||
memberMap,
|
||||
}) => {
|
||||
const styles = useChatScreenStyles();
|
||||
const scaleAnimation = useRef(new Animated.Value(0)).current;
|
||||
@@ -90,7 +92,7 @@ export const LongPressMenu: React.FC<LongPressMenuProps> = ({
|
||||
|
||||
// 复制文本到剪贴板
|
||||
const handleCopy = () => {
|
||||
const text = extractTextFromSegments(message.segments);
|
||||
const text = extractTextFromSegments(message.segments, memberMap);
|
||||
if (text) {
|
||||
Clipboard.setString(text);
|
||||
onClose();
|
||||
@@ -99,7 +101,7 @@ export const LongPressMenu: React.FC<LongPressMenuProps> = ({
|
||||
|
||||
// 多选功能(这里简化为复制全部)
|
||||
const handleMultiSelect = () => {
|
||||
const text = extractTextFromSegments(message.segments);
|
||||
const text = extractTextFromSegments(message.segments, memberMap);
|
||||
if (text) {
|
||||
Clipboard.setString(text);
|
||||
onClose();
|
||||
|
||||
Reference in New Issue
Block a user