mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-11 10:03:44 +01:00
lint: yup.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const nconf = require('nconf');
|
||||
const _ = require('lodash');
|
||||
|
||||
const user = require('../../user');
|
||||
const topics = require('../../topics');
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user