0
0
Fork 0

Introduce a bit of luck into the elefriend selection. #294.

This commit is contained in:
David Yip 2018-01-14 04:19:29 -06:00
parent 53cbc9933e
commit e64cc311dd
No known key found for this signature in database
GPG key ID: 7DA0036508FCC0CC
6 changed files with 25 additions and 12 deletions

View file

@ -38,6 +38,10 @@ import { overwrite } from 'flavours/glitch/util/js_helpers';
const totalElefriends = 3;
// ~4% chance you'll end up with an unexpected friend
// glitch-soc/mastodon repo created_at date: 2017-04-20T21:55:28Z
const glitchProbability = 1 - 0.0420215528;
const initialState = ImmutableMap({
mounted: false,
advanced_options: ImmutableMap({
@ -45,7 +49,7 @@ const initialState = ImmutableMap({
threaded_mode: false,
}),
sensitive: false,
elefriend: Math.floor(Math.random() * totalElefriends),
elefriend: Math.random() < glitchProbability ? Math.floor(Math.random() * totalElefriends) : totalElefriends,
spoiler: false,
spoiler_text: '',
privacy: null,