* territory specific trust * functional parity with master * revert back to materialized view for ranking * update query for populating subWeightedVotes * fix anon hot comments * fix zap denormalization, change weightedComments to be for zaps, order updates of ancestors to prevent deadlocks * reduce weight of comment zaps for hot score * do zap ancestor updates together * initialize trust in new/unpopular territories * simplify denormalization of zap/downzaps * recompute all scores
28 lines
558 B
JavaScript
28 lines
558 B
JavaScript
import { USER_ID } from '@/lib/constants'
|
|
|
|
export const GLOBAL_SEEDS = [USER_ID.k00b, USER_ID.ek]
|
|
|
|
export function initialTrust ({ name, userId }) {
|
|
const results = GLOBAL_SEEDS.map(id => ({
|
|
subName: name,
|
|
userId: id,
|
|
zapPostTrust: 1,
|
|
subZapPostTrust: 1,
|
|
zapCommentTrust: 1,
|
|
subZapCommentTrust: 1
|
|
}))
|
|
|
|
if (!GLOBAL_SEEDS.includes(userId)) {
|
|
results.push({
|
|
subName: name,
|
|
userId,
|
|
zapPostTrust: 0,
|
|
subZapPostTrust: 1,
|
|
zapCommentTrust: 0,
|
|
subZapCommentTrust: 1
|
|
})
|
|
}
|
|
|
|
return results
|
|
}
|