@@ -506,6 +506,11 @@ export const useClassroom = ({ user }:{ user : User }) => {
const sendMessage = async (): Promise<void> => {
if (!imMessageManager.current || !classId) return;
+ if (!msgText.trim()) {
+ showToast('error', '消息不能为空');
+ return;
+ }
+
try {
await imMessageManager.current.sendGroupMessage({
groupId: classId,