mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2024-10-01 06:55:46 -04:00
fixing bugs
This commit is contained in:
parent
fd63a0d5e0
commit
f780a60d69
@ -143,7 +143,8 @@ class SingleContactMessagesCubit extends Cubit<SingleContactMessagesState> {
|
||||
|
||||
// Open reconciled chat record key
|
||||
Future<void> _initReconciledMessagesCubit() async {
|
||||
final tableName = _localConversationRecordKey.toString();
|
||||
final tableName =
|
||||
_localConversationRecordKey.toString().replaceAll(':', '_');
|
||||
|
||||
final crypto = await _makeLocalMessagesCrypto();
|
||||
|
||||
|
@ -4,6 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:veilid_support/veilid_support.dart';
|
||||
|
||||
import '../../proto/proto.dart' as proto;
|
||||
import '../../proto/proto.dart' show messageFromJson, messageToJson;
|
||||
|
||||
part 'message_state.freezed.dart';
|
||||
part 'message_state.g.dart';
|
||||
@ -26,7 +27,7 @@ enum MessageSendState {
|
||||
class MessageState with _$MessageState {
|
||||
const factory MessageState({
|
||||
// Content of the message
|
||||
@JsonKey(fromJson: proto.messageFromJson, toJson: proto.messageToJson)
|
||||
@JsonKey(fromJson: messageFromJson, toJson: messageToJson)
|
||||
required proto.Message content,
|
||||
// Sent timestamp
|
||||
required Timestamp sentTimestamp,
|
||||
|
@ -105,6 +105,9 @@ class TableDBArrayCubit<T> extends Cubit<TableDBArrayBusyState<T>>
|
||||
) async {
|
||||
try {
|
||||
final length = _array.length;
|
||||
if (length == 0) {
|
||||
return AsyncValue.data(IList<T>.empty());
|
||||
}
|
||||
final end = ((tail - 1) % length) + 1;
|
||||
final start = (count < end) ? end - count : 0;
|
||||
final allItems =
|
||||
|
Loading…
Reference in New Issue
Block a user