From ec65faa12d6dcf2e248787c07cb5ada5b8c5da6e Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 21 Mar 2023 23:08:04 +0000 Subject: [PATCH] Assign all stock apps an emoji, show them in the app list, and let the editor set them. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4242 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/admin.json | 3 ++- apps/api.json | 3 ++- apps/apps.json | 3 ++- apps/apps/app.js | 26 ++++++++++++++++++-------- apps/db.json | 3 ++- apps/docs.json | 3 ++- apps/follow.json | 3 ++- apps/ssb.json | 3 ++- apps/ssb/tf-app.js | 2 +- apps/todo.json | 3 ++- core/client.js | 14 +++++++++++++- core/index.html | 1 + 12 files changed, 49 insertions(+), 18 deletions(-) diff --git a/apps/admin.json b/apps/admin.json index ac0280b4..711779a2 100644 --- a/apps/admin.json +++ b/apps/admin.json @@ -1,3 +1,4 @@ { - "type": "tildefriends-app" + "type": "tildefriends-app", + "emoji": "🎛" } \ No newline at end of file diff --git a/apps/api.json b/apps/api.json index ac0280b4..870ad76b 100644 --- a/apps/api.json +++ b/apps/api.json @@ -1,3 +1,4 @@ { - "type": "tildefriends-app" + "type": "tildefriends-app", + "emoji": "📜" } \ No newline at end of file diff --git a/apps/apps.json b/apps/apps.json index ac0280b4..762ca759 100644 --- a/apps/apps.json +++ b/apps/apps.json @@ -1,3 +1,4 @@ { - "type": "tildefriends-app" + "type": "tildefriends-app", + "emoji": "💻" } \ No newline at end of file diff --git a/apps/apps/app.js b/apps/apps/app.js index 787b010e..92e176e4 100644 --- a/apps/apps/app.js +++ b/apps/apps/app.js @@ -1,18 +1,28 @@ +async function fetch_info(apps) { + let result = {}; + for (let [key, value] of Object.entries(apps)) { + let blob = await ssb.blobGet(value); + blob = blob ? utf8Decode(blob) : '{}'; + result[key] = JSON.parse(blob); + } + return result; +} + async function main() { - var apps = await core.apps(); - var core_apps = await core.apps('core'); + var apps = await fetch_info(await core.apps()); + var core_apps = await fetch_info(await core.apps('core')); var doc = `