Skip to content

Commit fb9ec37

Browse files
authored
1 parent 84a8261 commit fb9ec37

File tree

2 files changed

+6
-1
lines changed
  • feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui
  • localization/src/main/res/values

2 files changed

+6
-1
lines changed

feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/ChatBox.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ import com.anytypeio.anytype.core_ui.foundation.noRippleClickable
8282
import com.anytypeio.anytype.core_ui.views.Caption1Medium
8383
import com.anytypeio.anytype.core_ui.views.Caption1Regular
8484
import com.anytypeio.anytype.core_ui.views.ContentMiscChat
85+
import com.anytypeio.anytype.core_utils.ext.toast
8586
import com.anytypeio.anytype.feature_chats.R
8687
import com.anytypeio.anytype.feature_chats.presentation.ChatView
8788
import com.anytypeio.anytype.feature_chats.presentation.ChatViewModel.ChatBoxMode
@@ -115,7 +116,7 @@ fun ChatBox(
115116
onUrlInserted: (Url) -> Unit,
116117
onImageCaptured: (Uri) -> Unit,
117118
onVideoCaptured: (Uri) -> Unit,
118-
onAttachmentMenuTriggered: () -> Unit
119+
onAttachmentMenuTriggered: () -> Unit,
119120
) {
120121

121122
val context = LocalContext.current
@@ -131,6 +132,9 @@ fun ChatBox(
131132
val uploadFileLauncher = rememberLauncherForActivityResult(
132133
ActivityResultContracts.OpenMultipleDocuments()
133134
) { uris ->
135+
if (uris.size > ChatConfig.MAX_ATTACHMENT_COUNT) {
136+
context.toast(context.getString(R.string.chats_warning_you_can_upload_only_10_files_at_a_time))
137+
}
134138
onChatBoxFilePicked(uris.take(ChatConfig.MAX_ATTACHMENT_COUNT))
135139
}
136140

localization/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,5 +2338,6 @@ Please provide specific details of your needs here.</string>
23382338

23392339
<!-- Multiplayer actions -->
23402340
<string name="multiplayer_approve">Approve</string>
2341+
<string name="chats_warning_you_can_upload_only_10_files_at_a_time">You can upload only 10 files at a time</string>
23412342

23422343
</resources>

0 commit comments

Comments
 (0)