use new api to get container data in one go

This commit is contained in:
Fabian Freund
2026-01-03 19:37:23 +01:00
parent 67a7a0909e
commit 3e21cf9129
8 changed files with 13 additions and 50 deletions
@@ -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',
);