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();
|
||||
|
||||
Reference in New Issue
Block a user