diff --git a/public/src/client/unread.js b/public/src/client/unread.js index 5ed9eed5c8..240d426a53 100644 --- a/public/src/client/unread.js +++ b/public/src/client/unread.js @@ -64,7 +64,7 @@ define('forum/unread', [ // Generate list of default categories based on topic list let defaultCategories = ajaxify.data.topics.reduce((map, topic) => { - const { category }= topic; + const { category } = topic; let { cid } = category; cid = utils.isNumber(cid) ? parseInt(cid, 10) : cid; map.set(cid, category); diff --git a/public/src/client/world.js b/public/src/client/world.js index 4642f9b6aa..111f8d7cca 100644 --- a/public/src/client/world.js +++ b/public/src/client/world.js @@ -97,7 +97,7 @@ define('forum/world', ['topicList', 'search', 'sort', 'hooks', 'alerts', 'api', hideEl.classList.toggle('hidden', !visibility); categoriesEl.classList.toggle('hidden', !visibility); localStorage.setItem('world:show-categories', visibility); - } + }; let visibility = localStorage.getItem('world:show-categories'); console.log('got value', visibility); diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index 37a9a5f32d..3bae10b50f 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -246,7 +246,12 @@ Mocks.category = async (actors) => { name, summary, followers, inbox, endpoints, tag, } = actor; preferredUsername = slugify(preferredUsername || name); - // const { followers: followerCount, following: followingCount } = await activitypub.actors.getLocalFollowCounts(uid); + /* + const { + followers: followerCount, + following: followingCount + } = await activitypub.actors.getLocalFollowCounts(uid); + */ try { ({ hostname } = new URL(actor.id)); @@ -257,7 +262,7 @@ Mocks.category = async (actors) => { // No support for category avatars yet ;( // let picture; // if (image) { - // picture = typeof image === 'string' ? image : image.url; + // picture = typeof image === 'string' ? image : image.url; // } const iconBackgrounds = await user.getIconBackgrounds(); let bgColor = Array.prototype.reduce.call(preferredUsername, (cur, next) => cur + next.charCodeAt(), 0); diff --git a/src/controllers/activitypub/topics.js b/src/controllers/activitypub/topics.js index b7d6da0095..3ca7c037f7 100644 --- a/src/controllers/activitypub/topics.js +++ b/src/controllers/activitypub/topics.js @@ -1,7 +1,6 @@ 'use strict'; const nconf = require('nconf'); -const _ = require('lodash'); const user = require('../../user'); const topics = require('../../topics'); diff --git a/src/user/follow.js b/src/user/follow.js index 5faf912ed2..7e561d07e5 100644 --- a/src/user/follow.js +++ b/src/user/follow.js @@ -86,7 +86,7 @@ module.exports = function (User) { // Filter out remote categories const isCategory = await db.exists(uids.map(uid => `categoryRemote:${uid}`)); - uids = uids.filter((uid, idx) => !isCategory[idx]) + uids = uids.filter((uid, idx) => !isCategory[idx]); const data = await plugins.hooks.fire(`filter:user.${type}`, { uids: uids, diff --git a/test/activitypub/actors.js b/test/activitypub/actors.js index 18d65a3fe0..687bc92a44 100644 --- a/test/activitypub/actors.js +++ b/test/activitypub/actors.js @@ -46,7 +46,7 @@ describe('Actor asserton', () => { publicKeyPem: 'somekey', }, }); - activitypub.helpers._webfingerCache.set('example@example.org', { actorUri }) + activitypub.helpers._webfingerCache.set('example@example.org', { actorUri }); }); it('should return true if successfully asserted', async () => { @@ -142,6 +142,7 @@ describe('Actor asserton', () => { await db.sortedSetAdd(`uid:${id}:shares`, Date.now(), tid); if (!x) { + // eslint-disable-next-line no-await-in-loop await topics.tools.move(tid, { cid, uid: 'system', @@ -172,8 +173,8 @@ describe('Actor asserton', () => { const states = await categories.getWatchState([id], followerUid); assert.strictEqual(states[0], categories.watchStates.tracking); - }) - }) + }); + }); }); describe('less happy paths', () => { @@ -214,7 +215,7 @@ describe('Actor asserton', () => { const response = await activitypub.actors.assert([id]); assert.deepStrictEqual(response, []); - }) + }); }); }); @@ -458,7 +459,7 @@ describe('Inbox resolution', () => { const { id, actor } = helpers.mocks.person({ endpoints: { sharedInbox: 'https://example.org/inbox', - } + }, }); await activitypub.actors.assert(id); @@ -486,7 +487,7 @@ describe('Inbox resolution', () => { const { id, actor } = helpers.mocks.group({ endpoints: { sharedInbox: 'https://example.org/inbox', - } + }, }); await activitypub.actors.assertGroup(id);