diff options
author | David Yip <yipdw@member.fsf.org> | 2018-01-14 04:19:29 -0600 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2018-01-14 04:46:21 -0600 |
commit | e64cc311dd8db5d56b6299e9d40e7060d0c25b7e (patch) | |
tree | 9c4a6c0e23a9c9e6f263630e9914672d3213831c /app/javascript/flavours/glitch/reducers/compose.js | |
parent | 53cbc9933eaaf7f57067dc897520d0be69c519a8 (diff) |
Introduce a bit of luck into the elefriend selection. #294.
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/compose.js')
-rw-r--r-- | app/javascript/flavours/glitch/reducers/compose.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index dfab38387..24f76cf86 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -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, |