decouple form parent when switching cookie context
This commit is contained in:
@@ -455,11 +455,19 @@ class TabRepository extends _$TabRepository {
|
||||
tabState.historyState.items.isEmpty;
|
||||
|
||||
if (event.blocked || tabIsEmpty) {
|
||||
// Check if contextual identity is changing
|
||||
final currentContainerData = await ref
|
||||
.read(tabDataRepositoryProvider.notifier)
|
||||
.getTabContainerData(tabState.id);
|
||||
|
||||
final contextChanging = containerData.metadata.contextualIdentity !=
|
||||
currentContainerData?.metadata.contextualIdentity;
|
||||
|
||||
await addTab(
|
||||
url: uri,
|
||||
private: tabState.isPrivate,
|
||||
container: Value(containerData),
|
||||
parentId: tabState.id,
|
||||
parentId: contextChanging ? null : tabState.id, // Break parent chain if context changes
|
||||
selectTab: true,
|
||||
);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ final class TabRepositoryProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$tabRepositoryHash() => r'0be3f9bb9eef6dfff1c486195e2717932c425db1';
|
||||
String _$tabRepositoryHash() => r'93afd4b4b6d007f02707bda0b860730b0dba5c5f';
|
||||
|
||||
abstract class _$TabRepository extends $Notifier<void> {
|
||||
void build();
|
||||
|
||||
@@ -58,7 +58,7 @@ class TabDataRepository extends _$TabDataRepository {
|
||||
url: tabState.url,
|
||||
private: tabState.isPrivate,
|
||||
container: Value(targetContainer),
|
||||
parentId: tabState.parentId,
|
||||
// parentId defaults to null - breaks parent chain when changing contextual identity
|
||||
selectTab: selectedTabId == tabState.id,
|
||||
);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class TabDataRepository extends _$TabDataRepository {
|
||||
url: tabState.url,
|
||||
private: tabState.isPrivate,
|
||||
container: const Value(null),
|
||||
parentId: tabState.parentId,
|
||||
// parentId defaults to null - breaks parent chain when removing contextual identity
|
||||
selectTab: selectedTabId == tabState.id,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ final class TabDataRepositoryProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$tabDataRepositoryHash() => r'502f2ce548d3a4d1506d239c9a2e506b9436c408';
|
||||
String _$tabDataRepositoryHash() => r'a01c38e94aad2145bd26aa0b8ff0bb1bcceb22f5';
|
||||
|
||||
abstract class _$TabDataRepository extends $Notifier<void> {
|
||||
void build();
|
||||
|
||||
Reference in New Issue
Block a user