From 9def7e7380b7c633c3328fcc0a0393865823b2a6 Mon Sep 17 00:00:00 2001 From: "Tran M. Cuong" Date: Wed, 28 Aug 2024 18:37:05 +0700 Subject: [PATCH] add back button on smartsearch source (#309) --- .../java/eu/kanade/presentation/browse/BrowseTabWrapper.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/eu/kanade/presentation/browse/BrowseTabWrapper.kt b/app/src/main/java/eu/kanade/presentation/browse/BrowseTabWrapper.kt index d16f82e7e1..1fd59b22e3 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/BrowseTabWrapper.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/BrowseTabWrapper.kt @@ -4,6 +4,7 @@ import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import cafe.adriel.voyager.navigator.LocalNavigator import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.TabContent @@ -13,6 +14,7 @@ import tachiyomi.presentation.core.i18n.stringResource @Composable fun BrowseTabWrapper(tab: TabContent) { val snackbarHostState = remember { SnackbarHostState() } + val navigator = LocalNavigator.current Scaffold( topBar = { scrollBehavior -> AppBar( @@ -21,6 +23,7 @@ fun BrowseTabWrapper(tab: TabContent) { AppBarActions(tab.actions) }, scrollBehavior = scrollBehavior, + navigateUp = { navigator?.pop() }, ) }, snackbarHost = { SnackbarHost(hostState = snackbarHostState) },