use new api to get container data in one go
This commit is contained in:
@@ -242,24 +242,16 @@ class TabRepository extends _$TabRepository {
|
||||
}
|
||||
|
||||
Future<bool> selectTab(String tabId) async {
|
||||
final containerId = await ref
|
||||
final containerData = await ref
|
||||
.read(tabDataRepositoryProvider.notifier)
|
||||
.getTabContainerId(tabId);
|
||||
|
||||
if (!ref.mounted) return false;
|
||||
|
||||
final containerData = await containerId.mapNotNull(
|
||||
(containerId) => ref
|
||||
.read(containerRepositoryProvider.notifier)
|
||||
.getContainerData(containerId),
|
||||
);
|
||||
.getTabContainerData(tabId);
|
||||
|
||||
if (!ref.mounted) return false;
|
||||
|
||||
if (containerData != null) {
|
||||
if (containerData.metadata.authSettings.authenticationRequired) {
|
||||
// ignore: only_use_keep_alive_inside_keep_alive
|
||||
if (containerId != ref.read(selectedContainerProvider)) {
|
||||
if (containerData.id != ref.read(selectedContainerProvider)) {
|
||||
logger.w(
|
||||
'Tried to open authenticated tab $tabId but container not selected',
|
||||
);
|
||||
|
||||
@@ -41,7 +41,7 @@ final class TabRepositoryProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$tabRepositoryHash() => r'ab4ba2bf11ccbd99497819b9068cbbd733a93d81';
|
||||
String _$tabRepositoryHash() => r'0be3f9bb9eef6dfff1c486195e2717932c425db1';
|
||||
|
||||
abstract class _$TabRepository extends $Notifier<void> {
|
||||
void build();
|
||||
|
||||
Reference in New Issue
Block a user