diff options
author | David Yip <yipdw@member.fsf.org> | 2018-01-08 09:43:57 -0600 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2018-01-08 09:45:59 -0600 |
commit | 2dc4fbbd1a13adbdca26a0b42ee6e289e736bba1 (patch) | |
tree | bf4ce6d99cf4c856e2cc0224044cc9aef12c2e0e | |
parent | 722b3f567f18ae31b05f320441c73279b4f5ad11 (diff) |
When pulling out max_toot_chars, handle nulls
flavours/glitch/util/initial_state is used in places where we want to exhibit different behavior based on user preferences. This means that it's used in places where no preference is defined, i.e. on an unauthenticated access. All values exported from that module must therefore expect that case; previously, the max chars value didn't. Addresses #306.
-rw-r--r-- | app/javascript/flavours/glitch/util/initial_state.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/util/initial_state.js b/app/javascript/flavours/glitch/util/initial_state.js index a22b68f6f..ab502f9d4 100644 --- a/app/javascript/flavours/glitch/util/initial_state.js +++ b/app/javascript/flavours/glitch/util/initial_state.js @@ -18,6 +18,6 @@ export const boostModal = getMeta('boost_modal'); export const favouriteModal = getMeta('favourite_modal'); export const deleteModal = getMeta('delete_modal'); export const me = getMeta('me'); -export const maxChars = initialState.max_toot_chars || 500; +export const maxChars = (initialState && initialState.max_toot_chars) || 500; export default initialState; |