when closing tab check for parent tab first #155
This commit is contained in:
@@ -293,6 +293,14 @@ class TabRepository extends _$TabRepository {
|
|||||||
|
|
||||||
if (!ref.mounted) return;
|
if (!ref.mounted) return;
|
||||||
|
|
||||||
|
// Priority 1: Check for parent tab first (if exists and in same container)
|
||||||
|
if (tabState?.parentId != null) {
|
||||||
|
if (sameContainerTabs.any((tab) => tab == tabState?.parentId)) {
|
||||||
|
return _tabsService.selectTab(tabId: tabState!.parentId!);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Priority 2: Check for previous tab by timestamp
|
||||||
final previousTabId = await ref
|
final previousTabId = await ref
|
||||||
.read(tabDatabaseProvider)
|
.read(tabDatabaseProvider)
|
||||||
.definitionsDrift
|
.definitionsDrift
|
||||||
@@ -305,12 +313,6 @@ class TabRepository extends _$TabRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tabState?.parentId != null) {
|
|
||||||
if (sameContainerTabs.any((tab) => tab == tabState?.parentId)) {
|
|
||||||
return _tabsService.selectTab(tabId: tabState!.parentId!);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ref.mounted) return;
|
if (!ref.mounted) return;
|
||||||
|
|
||||||
final previousOrderedTabId = await ref
|
final previousOrderedTabId = await ref
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ final class TabRepositoryProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$tabRepositoryHash() => r'6f3ddaa1929de2a6f8fed0e818802ab69baee220';
|
String _$tabRepositoryHash() => r'0158f3aeb942dda3dab07c1129ced1695c7703c7';
|
||||||
|
|
||||||
abstract class _$TabRepository extends $Notifier<void> {
|
abstract class _$TabRepository extends $Notifier<void> {
|
||||||
void build();
|
void build();
|
||||||
|
|||||||
Reference in New Issue
Block a user