Закрыты задачи бэклога по неочевидному поведению UI при ошибках отправки сообщений и блокировках со стороны Message-safety + добалено ограничение на размер сообщения
This commit is contained in:
@@ -5,6 +5,12 @@ import { ScrollView, Text, View } from "react-native";
|
||||
import { useApp } from "../../src/app-context";
|
||||
import { AppHeader } from "../../src/components/AppHeader";
|
||||
import { ScreenShell } from "../../src/components/ScreenShell";
|
||||
import {
|
||||
bindPendingFileIntent,
|
||||
bindPendingTextIntent,
|
||||
loadPendingTextIntent,
|
||||
pendingDialogKey,
|
||||
} from "../../src/pending-intent";
|
||||
import { dialogApi } from "../../src/services";
|
||||
import { ErrorNotice, Loading, styles } from "../../src/ui";
|
||||
import { spacing } from "../../src/theme";
|
||||
@@ -12,7 +18,7 @@ import { spacing } from "../../src/theme";
|
||||
export default function DialogsScreen() {
|
||||
const app = useApp();
|
||||
const router = useRouter();
|
||||
const requestKey = useRef(crypto.randomUUID());
|
||||
const requestKey = useRef(pendingDialogKey() ?? crypto.randomUUID());
|
||||
const chat = useQuery({
|
||||
queryKey: ["current-dialog", requestKey.current],
|
||||
queryFn: () => dialogApi.create(requestKey.current),
|
||||
@@ -20,7 +26,12 @@ export default function DialogsScreen() {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (chat.data) router.replace(`/dialogs/${chat.data.dialog_id}`);
|
||||
if (chat.data) {
|
||||
const intent = loadPendingTextIntent();
|
||||
if (intent && !intent.dialogId) bindPendingTextIntent(intent, chat.data.dialog_id);
|
||||
bindPendingFileIntent(chat.data.dialog_id);
|
||||
router.replace(`/dialogs/${chat.data.dialog_id}`);
|
||||
}
|
||||
}, [chat.data, router]);
|
||||
|
||||
if (app.authStatus !== "authenticated") {
|
||||
|
||||
Reference in New Issue
Block a user