chat: разрешить отправку поста только с файлами, без текста
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1017,7 +1017,8 @@ function chatThreadSendReply() {
|
||||
var rootId = chatCurrentThreadRootId;
|
||||
if (!input || !rootId) return;
|
||||
var message = input.value.trim();
|
||||
if (!message) return;
|
||||
var fileIds = chatThreadComposerFileIds.slice();
|
||||
if (!message && !fileIds.length) return;
|
||||
|
||||
var rootPost = chatPostsById[rootId];
|
||||
if (!rootPost) return;
|
||||
@@ -1026,7 +1027,7 @@ function chatThreadSendReply() {
|
||||
chatApiFetch('/posts', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({channel_id: rootPost.channel_id, message: message, root_id: rootId, file_ids: chatThreadComposerFileIds}),
|
||||
body: JSON.stringify({channel_id: rootPost.channel_id, message: message, root_id: rootId, file_ids: fileIds}),
|
||||
}).then(function (post) {
|
||||
input.value = '';
|
||||
chatThreadComposerFileIds = [];
|
||||
@@ -1053,10 +1054,10 @@ function chatSendMessage() {
|
||||
var input = document.getElementById('chat-composer-input');
|
||||
if (!input || !chatCurrentChannelId) return;
|
||||
var message = input.value.trim();
|
||||
if (!message) return;
|
||||
var fileIds = chatComposerFileIds.slice();
|
||||
if (!message && !fileIds.length) return;
|
||||
|
||||
var channelId = chatCurrentChannelId;
|
||||
var fileIds = chatComposerFileIds.slice();
|
||||
input.disabled = true;
|
||||
chatApiFetch('/posts', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user