diff --git a/apps/blog.json b/apps/blog.json index f1360fba..782fa7bf 100644 --- a/apps/blog.json +++ b/apps/blog.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🪵", - "previous": "&/KFqTPF8mpU1UEFMAsKMtjQxTNTR1W78PIfx+OkCbF0=.sha256" + "previous": "&TIrBnpN3iz3O9L9MCCteAcVJZjA83EKdcfu4SCM76VE=.sha256" } \ No newline at end of file diff --git a/apps/blog/blog.js b/apps/blog/blog.js index 6d14affd..4a3e0866 100644 --- a/apps/blog/blog.js +++ b/apps/blog/blog.js @@ -141,6 +141,7 @@ export function render_atom(blogs) { export async function get_posts() { let blogs = []; + let ids = await ssb.getIdentities(); await ssb.sqlAsync(` WITH blogs AS ( @@ -177,10 +178,11 @@ export async function get_posts() { name IS NOT NULL) WHERE author_rank = 1) SELECT blogs.*, names.name FROM blogs + JOIN json_each(?) AS self ON self.value = blogs.author JOIN public ON public.author = blogs.author LEFT OUTER JOIN names ON names.author = blogs.author ORDER BY blogs.timestamp DESC LIMIT 20 - `, [], function(row) { + `, [JSON.stringify(ids)], function(row) { blogs.push(row); }); return blogs;