Sending encrypted messages. Revealing some weird behavior, but it's working.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4438 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-09-01 01:34:01 +00:00
parent c8029388c9
commit 8f63bcbfbf
3 changed files with 80 additions and 9 deletions

View File

@ -243,7 +243,11 @@ class TfMessageElement extends LitElement {
async try_decrypt(content) {
let result = await tfrpc.rpc.try_decrypt(this.whoami, content);
if (result) {
this.decrypted = JSON.parse(result);
try {
this.decrypted = JSON.parse(result);
} catch {
this.decrypted = result;
}
} else {
this.decrypted = false;
}