stacker.news/lib/constants.js

51 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-06-20 16:26:23 +00:00
// XXX this is temporary until we have so many subs they have
// to be loaded from the server
2023-07-26 20:07:06 +00:00
const SUBS = ['bitcoin', 'nostr', 'tech', 'meta', 'jobs']
const SUBS_NO_JOBS = SUBS.filter(s => s !== 'jobs')
2023-07-27 00:18:42 +00:00
2023-07-26 20:07:06 +00:00
module.exports = {
NOFOLLOW_LIMIT: 100,
BOOST_MIN: 5000,
UPLOAD_SIZE_MAX: 2 * 1024 * 1024,
IMAGE_PIXELS_MAX: 35000000,
UPLOAD_TYPES_ALLOW: [
'image/gif',
'image/heic',
'image/png',
'image/jpeg',
'image/webp'
],
COMMENT_DEPTH_LIMIT: 10,
MAX_TITLE_LENGTH: 80,
MAX_POLL_CHOICE_LENGTH: 30,
ITEM_SPAM_INTERVAL: '10m',
MAX_POLL_NUM_CHOICES: 10,
MIN_POLL_NUM_CHOICES: 2,
ITEM_FILTER_THRESHOLD: 1.2,
DONT_LIKE_THIS_COST: 1,
COMMENT_TYPE_QUERY: ['comments', 'freebies', 'outlawed', 'borderland', 'all', 'bookmarks'],
SUBS,
SUBS_NO_JOBS,
USER_SORTS: ['stacked', 'spent', 'comments', 'posts', 'referrals'],
ITEM_SORTS: ['votes', 'comments', 'sats'],
WHENS: ['day', 'week', 'month', 'year', 'forever'],
ITEM_TYPES: context => {
const items = ['all', 'posts', 'comments', 'bounties', 'links', 'discussions', 'polls']
if (!context) {
items.push('bios', 'jobs')
}
items.push('freebies')
if (context === 'user') {
items.push('jobs', 'bookmarks')
}
return items
},
OLD_ITEM_DAYS: 3,
ANON_USER_ID: 27,
ANON_POST_FEE: 1000,
2023-08-09 21:49:50 +00:00
ANON_COMMENT_FEE: 100
}
export const OLD_ITEM_DAYS = 3
export const SSR = typeof window === 'undefined'