(feat): add message states
Some checks failed
/ build-web (push) Successful in 1m20s
/ build-desktop (linux) (push) Successful in 7m6s
/ build-mobile (push) Failing after 13m56s
/ release (push) Has been skipped

(qol): prep for mtp migration
This commit is contained in:
Alois 2026-06-26 10:54:25 +02:00
commit c484a3c303
6 changed files with 110 additions and 33 deletions

View file

@ -69,6 +69,8 @@ export default function InputComponent({
return;
}
log(3, "chat", "purple", "Message send init, adding live message ...");
const reference = addLiveMessage({
height: 0,
not_encrypted: true,
@ -78,7 +80,19 @@ export default function InputComponent({
message_state: "awaiting",
});
const encryptedContext = await encryptText(sharedSecret, currentValue);
log(3, "chat", "purple", "Live message added, encrypting...");
const encryptedContext = await encryptText(
sharedSecret,
currentValue,
).catch((err) => {
toast("error", "Failed to encrypt message", String(err));
reference.setFailed(true);
});
if (!encryptedContext) return;
log(3, "chat", "purple", "Content encrypted, sending message...");
send("message_send", {
height: 0,
@ -96,6 +110,8 @@ export default function InputComponent({
toast("error", "Failed to send message");
});
log(3, "chat", "purple", "Message sent");
moveUserIdToTop(userId);
if (!preserveContent) {