Restrict message size on input

Signed-off-by: Volodymyr Kozieiev <vkjr.sp@gmail.com>
This commit is contained in:
Volodymyr Kozieiev 2020-08-25 11:51:49 +03:00
parent 17c408bd06
commit 0ab227eef8
No known key found for this signature in database
GPG Key ID: 82B04968DF4C0535
2 changed files with 4 additions and 0 deletions

View File

@ -12,3 +12,5 @@
{1 2000 {1 2000
2 5000 2 5000
3 10000}) 3 10000})
(def max-text-size 4096)

View File

@ -6,6 +6,7 @@
[quo.design-system.colors :as colors] [quo.design-system.colors :as colors]
[status-im.ui.screens.chat.components.style :as styles] [status-im.ui.screens.chat.components.style :as styles]
[status-im.ui.screens.chat.components.reply :as reply] [status-im.ui.screens.chat.components.reply :as reply]
[status-im.chat.constants :as chat.constants]
[status-im.utils.utils :as utils.utils] [status-im.utils.utils :as utils.utils]
[quo.components.animated.pressable :as pressable] [quo.components.animated.pressable :as pressable]
[quo.animated :as animated] [quo.animated :as animated]
@ -86,6 +87,7 @@
:auto-focus false :auto-focus false
:on-focus #(set-active-panel nil) :on-focus #(set-active-panel nil)
:on-change #(on-text-change (.-text ^js (.-nativeEvent ^js %))) :on-change #(on-text-change (.-text ^js (.-nativeEvent ^js %)))
:max-length chat.constants/max-text-size
:placeholder-text-color (:text-02 @colors/theme) :placeholder-text-color (:text-02 @colors/theme)
:placeholder (if cooldown-enabled? :placeholder (if cooldown-enabled?
(i18n/label :cooldown/text-input-disabled) (i18n/label :cooldown/text-input-disabled)