use tabStateWithFallback
This commit is contained in:
@@ -263,6 +263,17 @@ TabState? tabState(Ref ref, String? tabId) {
|
||||
return ref.watch(tabStatesProvider.select((tabs) => tabs[tabId]));
|
||||
}
|
||||
|
||||
@Riverpod()
|
||||
Future<TabState> tabStateWithFallback(Ref ref, String tabId) async {
|
||||
final state = ref.watch(tabStateProvider(tabId));
|
||||
|
||||
if (state != null) {
|
||||
return state;
|
||||
}
|
||||
|
||||
return await ref.read(tabStatesProvider.notifier).patchedState(tabId);
|
||||
}
|
||||
|
||||
@Riverpod()
|
||||
Future<bool> isTabTunneled(Ref ref, String? tabId) async {
|
||||
final tabState = ref.watch(tabStateProvider(tabId));
|
||||
|
||||
Reference in New Issue
Block a user