Fixed reload bug when clicking on a user
This commit is contained in:
parent
0e5a010937
commit
00659c4001
3 changed files with 34 additions and 5 deletions
|
|
@ -41,6 +41,17 @@ export default function InputComponent() {
|
|||
const time = Date.now();
|
||||
const currentValue = value;
|
||||
const currentUserId = userId();
|
||||
const currentSharedSecret = sharedSecret();
|
||||
|
||||
if (!Number.isSafeInteger(currentUserId) || currentUserId <= 0) {
|
||||
toast("error", "No conversation selected");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentSharedSecret) {
|
||||
toast("error", "Conversation key not ready yet");
|
||||
return;
|
||||
}
|
||||
|
||||
addLiveMessage({
|
||||
height: 0,
|
||||
|
|
@ -50,7 +61,7 @@ export default function InputComponent() {
|
|||
sent_by_self: true,
|
||||
});
|
||||
|
||||
const encryptedContext = await encrypt(sharedSecret(), currentValue);
|
||||
const encryptedContext = await encrypt(currentSharedSecret, currentValue);
|
||||
|
||||
send("message_send", {
|
||||
height: 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue