File tree Expand file tree Collapse file tree
kotlin/src/main/java/com/ditto/dittochat/ui
swift/Sources/DittoChatCore/Data Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ import kotlinx.coroutines.launch
99import javax.inject.Inject
1010import com.ditto.dittochat.DittoChat
1111import com.ditto.dittochat.RoomConfig
12+ import kotlinx.coroutines.CoroutineScope
13+ import kotlinx.coroutines.Dispatchers
1214
1315class RoomEditViewModel (
1416 private val dittoChat : DittoChat
15- ) : ViewModel() {
17+ ) {
1618
1719 private val _roomName = MutableStateFlow (" " )
1820 val roomName: StateFlow <String > = _roomName .asStateFlow()
@@ -29,7 +31,7 @@ class RoomEditViewModel(
2931 fun createRoom (onSuccess : () -> Unit ) {
3032 if (_roomName .value.isEmpty()) return
3133
32- viewModelScope .launch {
34+ CoroutineScope ( Dispatchers . Main ) .launch {
3335 _isCreating .value = true
3436 try {
3537 dittoChat.createRoom(
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ extension DittoService {
226226 let retentionDaysAgo = Date ( ) . addingTimeInterval ( - retentionDaysDouble * 24 * 60 * 60 )
227227 let query = """
228228 SELECT * FROM COLLECTION ` \( room. messagesId) ` ( \( thumbnailImageTokenKey) ATTACHMENT, \( largeImageTokenKey) ATTACHMENT)
229- WHERE roomId == :roomId AND createdOn >= :date OR timeMs >= :dateMs OR b >= :dateMs
229+ WHERE roomId == :roomId AND createdOn >= :date
230230 ORDER BY \( createdOnKey) ASC
231231 """
232232 let args : [ String : Any ? ] = [
You can’t perform that action at this time.
0 commit comments