From b3c9ad2fcbbdde0003be3f41b6d0560c003f7a43 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 7 Nov 2023 23:31:12 +0000 Subject: [PATCH] Two wiki fixes that I've redone multiple times. :/ git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4616 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/wiki.json | 2 +- apps/wiki/app.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/wiki.json b/apps/wiki.json index b0f63af5..416773bd 100644 --- a/apps/wiki.json +++ b/apps/wiki.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "📝", - "previous": "&0dFKAKThgExsyMQN99dOX7HP4UBhYYnuhYTILTCO5FI=.sha256" + "previous": "&s6S7S8P4kxvqLRip/WX45Bw7h+GG79BjJRBZOnaDtaE=.sha256" } \ No newline at end of file diff --git a/apps/wiki/app.js b/apps/wiki/app.js index 88fee9eb..045cc284 100644 --- a/apps/wiki/app.js +++ b/apps/wiki/app.js @@ -93,12 +93,16 @@ async function process_message(whoami, collection, message, kind, parent) { let content = JSON.parse(message.content); if (typeof content == 'string') { let x; - for (let id of whoami) { + for (let id of (whoami || [])) { x = await ssb.privateMessageDecrypt(id, content); if (x) { - content = JSON.parse(x); - content.draft = true; - break; + try { + content = JSON.parse(x); + content.draft = true; + break; + } catch { + return; + } } } if (!x) {