Фикс краша приложения при попытке вставки и ответа на сообщения
This commit is contained in:
@@ -104,6 +104,12 @@ export function DialogInput() {
|
|||||||
}, [dialog, editableDivRef]);
|
}, [dialog, editableDivRef]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if(systemAccounts.find((acc) => acc.publicKey == dialog)){
|
||||||
|
/**
|
||||||
|
* У системных аккаунтов нельзя отвечать на сообщения
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(replyMessages.inDialogInput && replyMessages.inDialogInput == dialog){
|
if(replyMessages.inDialogInput && replyMessages.inDialogInput == dialog){
|
||||||
setAttachments([{
|
setAttachments([{
|
||||||
type: AttachmentType.MESSAGES,
|
type: AttachmentType.MESSAGES,
|
||||||
@@ -111,7 +117,9 @@ export function DialogInput() {
|
|||||||
blob: JSON.stringify([...replyMessages.messages]),
|
blob: JSON.stringify([...replyMessages.messages]),
|
||||||
preview: ""
|
preview: ""
|
||||||
}]);
|
}]);
|
||||||
editableDivRef.current.focus();
|
if(editableDivRef.current){
|
||||||
|
editableDivRef.current.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [dialog, replyMessages]);
|
}, [dialog, replyMessages]);
|
||||||
|
|
||||||
@@ -208,6 +216,12 @@ export function DialogInput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onClickCamera = async () => {
|
const onClickCamera = async () => {
|
||||||
|
if(systemAccounts.find((acc) => acc.publicKey == dialog)){
|
||||||
|
/**
|
||||||
|
* У системных аккаунтов нельзя вызывать вложения
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(avatars.length == 0){
|
if(avatars.length == 0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -217,7 +231,9 @@ export function DialogInput() {
|
|||||||
type: AttachmentType.AVATAR,
|
type: AttachmentType.AVATAR,
|
||||||
preview: await base64ImageToBlurhash(avatars[0].avatar)
|
preview: await base64ImageToBlurhash(avatars[0].avatar)
|
||||||
}]);
|
}]);
|
||||||
editableDivRef.current.focus();
|
if(editableDivRef.current){
|
||||||
|
editableDivRef.current.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendTypeingPacket = () => {
|
const sendTypeingPacket = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user