new setting to define tab bar swipe action
This commit is contained in:
@@ -7,7 +7,7 @@ part of 'providers.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$selectionActionServiceHash() =>
|
||||
r'b1deac5e0566443b4729656c7082903b529bc269';
|
||||
r'c89d981c2ba253ed940887fa59c11ad93d8589a8';
|
||||
|
||||
/// See also [selectionActionService].
|
||||
@ProviderFor(selectionActionService)
|
||||
|
||||
@@ -48,7 +48,6 @@ part 'tab.g.dart';
|
||||
class TabRepository extends _$TabRepository {
|
||||
final _tabsService = GeckoTabService();
|
||||
|
||||
String? _previousTabId;
|
||||
final _tabFromIntent = <String>{};
|
||||
|
||||
bool hasLaunchedFromIntent(String? tabId) {
|
||||
@@ -124,9 +123,40 @@ class TabRepository extends _$TabRepository {
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> selectPreviousTab() async {
|
||||
if (_previousTabId != null) {
|
||||
return selectTab(_previousTabId!);
|
||||
Future<bool> selectPreviouslyOpenedTab(String tabId) async {
|
||||
final previousTabId = await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.previousTabByTimestamp(tabId: tabId)
|
||||
.getSingleOrNull();
|
||||
|
||||
if (previousTabId != null) {
|
||||
return selectTab(previousTabId);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<bool> selectPreviousTab(String tabId) async {
|
||||
final previousTabId = await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.previousTabByOrderKey(tabId: tabId)
|
||||
.getSingleOrNull();
|
||||
|
||||
if (previousTabId != null) {
|
||||
return selectTab(previousTabId);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<bool> selectNextTab(String tabId) async {
|
||||
final previousTabId = await ref
|
||||
.read(tabDatabaseProvider)
|
||||
.nextTabByOrderKey(tabId: tabId)
|
||||
.getSingleOrNull();
|
||||
|
||||
if (previousTabId != null) {
|
||||
return selectTab(previousTabId);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -283,7 +313,6 @@ class TabRepository extends _$TabRepository {
|
||||
selectedTabProvider,
|
||||
(previous, tabId) async {
|
||||
if (tabId != null) {
|
||||
_previousTabId = previous;
|
||||
await db.tabDao.touchTab(tabId, timestamp: DateTime.now());
|
||||
}
|
||||
},
|
||||
@@ -303,10 +332,6 @@ class TabRepository extends _$TabRepository {
|
||||
final syncTabs =
|
||||
next.value.isNotEmpty || (previous?.value.isNotEmpty ?? false);
|
||||
|
||||
if (_previousTabId != null && !next.value.contains(_previousTabId)) {
|
||||
_previousTabId = null;
|
||||
}
|
||||
|
||||
if (syncTabs) {
|
||||
await db.tabDao.syncTabs(retainTabIds: next.value);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ part of 'tab.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$tabRepositoryHash() => r'3465f351f1d36e0f21b4e8ef4ebe7fdc4fbc0b75';
|
||||
String _$tabRepositoryHash() => r'4f562c1456eadcda7986ea2048667dd083f37618';
|
||||
|
||||
/// See also [TabRepository].
|
||||
@ProviderFor(TabRepository)
|
||||
|
||||
Reference in New Issue
Block a user