|
|
|
@ -10,6 +10,7 @@ import _ from 'lodash'
@@ -10,6 +10,7 @@ import _ from 'lodash'
|
|
|
|
|
import { useCallback, useEffect, useState } from 'react' |
|
|
|
|
import Clipboard from '@react-native-community/clipboard' |
|
|
|
|
import { chatMessageManager } from '@/managers/chat-message.manager' |
|
|
|
|
import { useNetInfo } from '@react-native-community/netinfo' |
|
|
|
|
|
|
|
|
|
interface IProps { |
|
|
|
|
messages: IChatMessage[] |
|
|
|
@ -18,6 +19,7 @@ interface IProps {
@@ -18,6 +19,7 @@ interface IProps {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const usePinedMessages = ({ messages, role, onPress }: IProps) => { |
|
|
|
|
const { isConnected } = useNetInfo() |
|
|
|
|
const [activeInd, setActiveInd] = useState(null) |
|
|
|
|
|
|
|
|
|
const nav = useNav() |
|
|
|
@ -69,7 +71,7 @@ export const usePinedMessages = ({ messages, role, onPress }: IProps) => {
@@ -69,7 +71,7 @@ export const usePinedMessages = ({ messages, role, onPress }: IProps) => {
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
const copyEnablesTypes = [MessageType.Text, MessageType.Image] |
|
|
|
|
const canCopy = copyEnablesTypes.includes(messages[activeInd].type) |
|
|
|
|
const canCopy = isConnected ? copyEnablesTypes.includes(messages[activeInd].type) : messages[activeInd].type === MessageType.Text |
|
|
|
|
|
|
|
|
|
if (!canCopy) options.shift() |
|
|
|
|
|
|
|
|
|