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