mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-09-01 06:24:07 +00:00
some smaller bug fixes
Some checks failed
Flutter analyze & test / flutter_analyze_and_test (push) Has been cancelled
Some checks failed
Flutter analyze & test / flutter_analyze_and_test (push) Has been cancelled
This commit is contained in:
parent
8505ed865a
commit
eade1d87e6
8 changed files with 33 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ import 'package:twonly/src/database/tables/mediafiles.table.dart';
|
|||
enum MessageType { media, text, contacts, restoreFlameCounter, askAboutUser }
|
||||
|
||||
@DataClassName('Message')
|
||||
@TableIndex(name: 'idx_messages_group_id_created_at', columns: {#groupId, #createdAt})
|
||||
class Messages extends Table {
|
||||
TextColumn get groupId =>
|
||||
text().references(Groups, #groupId, onDelete: KeyAction.cascade)();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:twonly/src/database/tables/contacts.table.dart';
|
|||
import 'package:twonly/src/database/tables/messages.table.dart';
|
||||
|
||||
@DataClassName('Receipt')
|
||||
@TableIndex(name: 'idx_receipts_message_id', columns: {#messageId})
|
||||
class Receipts extends Table {
|
||||
TextColumn get receiptId => text()();
|
||||
|
||||
|
|
|
|||
|
|
@ -13843,6 +13843,14 @@ abstract class _$TwonlyDB extends GeneratedDatabase {
|
|||
);
|
||||
late final $LabelsTable labels = $LabelsTable(this);
|
||||
late final $ContactLabelsTable contactLabels = $ContactLabelsTable(this);
|
||||
late final Index idxMessagesGroupIdCreatedAt = Index(
|
||||
'idx_messages_group_id_created_at',
|
||||
'CREATE INDEX idx_messages_group_id_created_at ON messages (group_id, created_at)',
|
||||
);
|
||||
late final Index idxReceiptsMessageId = Index(
|
||||
'idx_receipts_message_id',
|
||||
'CREATE INDEX idx_receipts_message_id ON receipts (message_id)',
|
||||
);
|
||||
late final MessagesDao messagesDao = MessagesDao(this as TwonlyDB);
|
||||
late final ContactsDao contactsDao = ContactsDao(this as TwonlyDB);
|
||||
late final ReceiptsDao receiptsDao = ReceiptsDao(this as TwonlyDB);
|
||||
|
|
@ -13889,6 +13897,8 @@ abstract class _$TwonlyDB extends GeneratedDatabase {
|
|||
shortcutMembers,
|
||||
labels,
|
||||
contactLabels,
|
||||
idxMessagesGroupIdCreatedAt,
|
||||
idxReceiptsMessageId,
|
||||
];
|
||||
@override
|
||||
StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([
|
||||
|
|
|
|||
|
|
@ -140,6 +140,9 @@ signalDecryptMessageV1(
|
|||
) = await lockingSignalProtocol.protect(() async {
|
||||
Log.info('Lock acquired for $fromUserId (V1)');
|
||||
try {
|
||||
// Yield execution to the event loop to prevent UI freezing during bulk decryption
|
||||
await Future.delayed(Duration.zero);
|
||||
|
||||
final session = SessionCipher.fromStore(
|
||||
(await getSignalStore())!,
|
||||
getSignalAddress(fromUserId),
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
|
|||
contactSub?.cancel();
|
||||
groupActionsSub?.cancel();
|
||||
_nextTypingIndicator?.cancel();
|
||||
textFieldFocus?.dispose();
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,13 @@ class _BackupRecoveryViewState extends State<BackupRecoveryView> {
|
|||
final TextEditingController usernameCtrl = TextEditingController();
|
||||
final TextEditingController passwordCtrl = TextEditingController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
usernameCtrl.dispose();
|
||||
passwordCtrl.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _recoverTwonlySafe() async {
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,14 @@ class DataAndStorageView extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _DataAndStorageViewState extends State<DataAndStorageView> {
|
||||
late Future<Map<MediaType, int>> _storageStatsFuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_storageStatsFuture = twonlyDB.mediaFilesDao.getStorageStats();
|
||||
}
|
||||
|
||||
Future<void> showAutoDownloadOptions(
|
||||
BuildContext context,
|
||||
ConnectivityResult connectionMode,
|
||||
|
|
@ -93,7 +101,7 @@ class _DataAndStorageViewState extends State<DataAndStorageView> {
|
|||
return ListView(
|
||||
children: [
|
||||
FutureBuilder<Map<MediaType, int>>(
|
||||
future: twonlyDB.mediaFilesDao.getStorageStats(),
|
||||
future: _storageStatsFuture,
|
||||
builder: (context, snapshot) {
|
||||
final stats = snapshot.data ?? {};
|
||||
final totalBytes = stats.values.fold<int>(0, (a, b) => a + b);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
|
|||
|
||||
publish_to: 'none'
|
||||
|
||||
version: 0.5.0+168
|
||||
version: 0.5.0+169
|
||||
|
||||
environment:
|
||||
sdk: ^3.11.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue