intermediate
This commit is contained in:
@@ -403,8 +403,8 @@ abstract class _$ChatSearchDatabase extends GeneratedDatabase {
|
||||
chatFts,
|
||||
}).map((QueryRow row) => ChatQueryResult(
|
||||
fileName: row.read<String>('file_name'),
|
||||
title: row.read<String>('title'),
|
||||
contentSnippet: row.read<String>('content_snippet'),
|
||||
title: row.readNullable<String>('title'),
|
||||
contentSnippet: row.readNullable<String>('content_snippet'),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -702,11 +702,11 @@ class $ChatSearchDatabaseManager {
|
||||
|
||||
class ChatQueryResult {
|
||||
final String fileName;
|
||||
final String title;
|
||||
final String contentSnippet;
|
||||
final String? title;
|
||||
final String? contentSnippet;
|
||||
ChatQueryResult({
|
||||
required this.fileName,
|
||||
required this.title,
|
||||
required this.contentSnippet,
|
||||
this.title,
|
||||
this.contentSnippet,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:drift/native.dart';
|
||||
import 'package:lensai/features/chat_archive/data/database/database.dart';
|
||||
@@ -12,7 +14,7 @@ part 'providers.g.dart';
|
||||
|
||||
@Riverpod()
|
||||
ChatSearchDatabase chatSearchDatabase(Ref ref) {
|
||||
return ChatSearchDatabase(
|
||||
final db = ChatSearchDatabase(
|
||||
LazyDatabase(() async {
|
||||
// Also work around limitations on old Android versions
|
||||
if (Platform.isAndroid) {
|
||||
@@ -29,4 +31,10 @@ ChatSearchDatabase chatSearchDatabase(Ref ref) {
|
||||
return NativeDatabase.memory();
|
||||
}),
|
||||
);
|
||||
|
||||
ref.onDispose(() {
|
||||
unawaited(db.close());
|
||||
});
|
||||
|
||||
return db;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ part of 'providers.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$chatSearchDatabaseHash() =>
|
||||
r'99700f1a2c25b24742c60fa8dd91fe744dcf21be';
|
||||
r'17c972b3da21b6a2365cc5fd56a4eade0ac0a3f3';
|
||||
|
||||
/// See also [chatSearchDatabase].
|
||||
@ProviderFor(chatSearchDatabase)
|
||||
|
||||
@@ -91,9 +91,10 @@ class ChatArchiveSearchScreen extends HookConsumerWidget {
|
||||
chatEntity.dateTime!.formatWithMinutePrecision(),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
MarkdownBody(
|
||||
data: chat.contentSnippet,
|
||||
),
|
||||
if (chat.contentSnippet != null)
|
||||
MarkdownBody(
|
||||
data: chat.contentSnippet!,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user