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