improved tab handling by id

This commit is contained in:
Fabian Freund
2024-08-19 04:27:47 +02:00
parent a465195ec4
commit 23dad27d61
12 changed files with 78 additions and 40 deletions
@@ -542,7 +542,7 @@ class KagiScreen extends HookConsumerWidget {
if (activeWebView?.key != null && webViews.length > 1) {
ref
.read(webViewRepositoryProvider.notifier)
.closeTab(activeWebView!.key!);
.closeTab(activeWebView!.tabId);
return true;
} else {
//Mark back as unhandled and navigator will pop
@@ -584,13 +584,13 @@ class KagiScreen extends HookConsumerWidget {
(activeWebView != null)
? webViews.keys
.toList()
.indexOf(activeWebView.page.value.key)
.indexOf(activeWebView.tabId)
: null,
),
index: (activeWebView != null)
? webViews.keys
.toList()
.indexOf(activeWebView.page.value.key) +
.indexOf(activeWebView.tabId) +
1
: 0,
children: [const LandingContent(), ...webViews.values],