fix isolated tab handling
This commit is contained in:
1 parent
ea6226e2bd
commit
a4d66affcb
5 files changed
+9
-7
No files matched your search
@@ -525,12 +525,13 @@ class TabDao extends DatabaseAccessor<TabDatabase> with $TabDaoMixin {
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<String>> getUnassignedTabsOlderThan(DateTime threshold) {
|
||||
Future<List<String>> getUnassignedRegularTabsOlderThan(DateTime threshold) {
|
||||
final query = selectOnly(db.tab)
|
||||
..addColumns([db.tab.id])
|
||||
..where(
|
||||
db.tab.containerId.isNull() &
|
||||
db.tab.timestamp.isSmallerThanValue(threshold),
|
||||
db.tab.timestamp.isSmallerThanValue(threshold) &
|
||||
db.tab.tabMode.equalsValue(TabModeDbValue.regular),
|
||||
);
|
||||
|
||||
return query.map((row) => row.read(db.tab.id)!).get();
|
||||
|
||||
@@ -277,7 +277,7 @@ class TabDataRepository extends _$TabDataRepository {
|
||||
final tabIds = await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.tabDao
|
||||
.getUnassignedTabsOlderThan(threshold);
|
||||
.getUnassignedRegularTabsOlderThan(threshold);
|
||||
|
||||
if (tabIds.isNotEmpty) {
|
||||
await ref.read(tabRepositoryProvider.notifier).closeTabs(tabIds);
|
||||
|
||||
Reference in new issue
Block a user