l-min-components 1.0.1042 → 1.0.1048

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.1042",
3
+ "version": "1.0.1048",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -93,7 +93,7 @@ const HeaderComponent = (props) => {
93
93
  handleGetUnreadNotification(accountType);
94
94
  }
95
95
 
96
- if (accountType & accountType === "personal") {
96
+ if (accountType && accountType === "personal") {
97
97
  handleGetUnreadNotificationPersonal()
98
98
  }
99
99
  }, [accountType]);
@@ -43,6 +43,8 @@ const InputSection = ({
43
43
  accountType,
44
44
  affiliates,
45
45
  courseID,
46
+ handleCreateMessage,
47
+ createMessageData,
46
48
  }) => {
47
49
  const [showEmoji, setShowEmoji] = useState();
48
50
  const [inputMethod, setInputMethod] = useState("text"); // text | recorder
@@ -56,8 +58,7 @@ const InputSection = ({
56
58
 
57
59
  const imageRef = useRef();
58
60
  const {
59
- handleCreateMessage,
60
- createMessageData,
61
+
61
62
  handleCreateMessageWithMedia,
62
63
  createMessageWithMediaData,
63
64
  createMessageAffiliateData,
@@ -94,29 +95,10 @@ const InputSection = ({
94
95
  if (inputMethod === "text") {
95
96
  // setNewMessages((prev) => [...prev, text]);
96
97
  setIsMessageSending(true);
97
- if (affiliates && accountType === "instructor") {
98
- setTimeout(() => {
99
- handleCreateMessageAffiliate(userID, text);
100
- }, 1000);
101
- }
102
-
103
- if (!affiliates && accountType === "instructor") {
104
- setTimeout(() => {
105
- handleCreateMessage(userID, accountType, text);
106
- }, 1000);
107
- }
108
98
 
109
- if (accountType === "enterprise") {
110
- setTimeout(() => {
111
- handleCreateMessage(userID, accountType, text, courseID);
112
- }, 1000);
113
- }
114
-
115
- if (accountType === "personal") {
116
- setTimeout(() => {
117
- handleCreateMessagePersonal(userID, text, courseID);
118
- }, 1000);
119
- }
99
+ setTimeout(() => {
100
+ handleCreateMessage(userID, accountType, text, courseID, "");
101
+ }, 1000);
120
102
  }
121
103
  };
122
104
 
@@ -255,12 +237,17 @@ const InputSection = ({
255
237
  </div>
256
238
  <button
257
239
  className={`send-box ${
258
- !text.text && (inputMethod === "text" || recording) ? "disabled" : ""
240
+ (!text.text && inputMethod !== "recorder") ||
241
+ createMessageData?.loading ||
242
+ recording
243
+ ? "disabled"
244
+ : ""
259
245
  }`}
260
246
  onClick={handleSendMessage}
261
247
  disabled={
262
- !text.text &&
263
- (inputMethod === "text" || recording || createMessageData?.loading)
248
+ (!text.text && inputMethod !== "recorder") ||
249
+ createMessageData?.loading ||
250
+ recording
264
251
  }
265
252
  >
266
253
  <SendIcon />