@smart-link/rn-im 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,12 +69,12 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
69
69
  const keyboardHeight = (0, react_1.useRef)(240);
70
70
  const handleChange = (0, react_1.useCallback)((text) => {
71
71
  tempText.current = text;
72
- const trimTxt = text.trim();
73
- if (trimTxt.length && !lazy.current) {
72
+ // const trimTxt = text.trim();
73
+ if (text.length && !lazy.current) {
74
74
  setShowSend(true);
75
75
  lazy.current = true;
76
76
  }
77
- else if (!trimTxt.length) {
77
+ else if (!text.length) {
78
78
  setShowSend(false);
79
79
  lazy.current = false;
80
80
  }
@@ -154,6 +154,23 @@ const MessageBar = (0, react_1.forwardRef)(({ onKeyboardAt }, ref) => {
154
154
  const handleSendText = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {
155
155
  var _a, _b;
156
156
  const text = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.getText();
157
+ if (text.trim().length === 0) {
158
+ const { close } = rn_ui_1.Modal.open({
159
+ title: t('tips'),
160
+ content: t('cantSendEmptyMsg'),
161
+ footer: {
162
+ confirmButton: {
163
+ text: t('confirm'),
164
+ onPress: () => {
165
+ close();
166
+ return true;
167
+ }
168
+ },
169
+ cancelButton: false,
170
+ }
171
+ });
172
+ return;
173
+ }
157
174
  (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.clear();
158
175
  tempText.current = '';
159
176
  handleChange('');
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@smart-link/rn-im",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "dependencies": {
7
7
  "color": "^5.0.0",
8
8
  "lodash-es": "^4.17.21",
9
9
  "emoji-regex": "^10.4.0",
10
- "@smart-link/im-base": "^1.0.10"
10
+ "@smart-link/im-base": "^1.0.11"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@react-native/eslint-config": "0.73.2",