fix isolated tab handling
This commit is contained in:
@@ -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