Update for clear history

This commit is contained in:
Luna712 2023-10-02 12:16:50 -06:00 committed by GitHub
parent 25ef10bf7b
commit 607b6d5dcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,6 +55,7 @@ import com.lagradost.cloudstream3.utils.AppUtils.setDefaultFocus
import com.lagradost.cloudstream3.utils.Coroutines.main import com.lagradost.cloudstream3.utils.Coroutines.main
import com.lagradost.cloudstream3.utils.DataStore.getKey import com.lagradost.cloudstream3.utils.DataStore.getKey
import com.lagradost.cloudstream3.utils.DataStore.setKey import com.lagradost.cloudstream3.utils.DataStore.setKey
import com.lagradost.cloudstream3.utils.DataStoreHelper.currentAccount
import com.lagradost.cloudstream3.utils.SubtitleHelper import com.lagradost.cloudstream3.utils.SubtitleHelper
import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe import com.lagradost.cloudstream3.utils.UIHelper.dismissSafe
import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar
@ -398,7 +399,7 @@ class SearchFragment : Fragment() {
DialogInterface.OnClickListener { _, which -> DialogInterface.OnClickListener { _, which ->
when (which) { when (which) {
DialogInterface.BUTTON_POSITIVE -> { DialogInterface.BUTTON_POSITIVE -> {
removeKeys(SEARCH_HISTORY_KEY) removeKeys("$currentAccount/$SEARCH_HISTORY_KEY")
searchViewModel.updateHistory() searchViewModel.updateHistory()
} }
DialogInterface.BUTTON_NEGATIVE -> { DialogInterface.BUTTON_NEGATIVE -> {
@ -510,7 +511,7 @@ class SearchFragment : Fragment() {
binding?.mainSearch?.setQuery(searchItem.searchText, true) binding?.mainSearch?.setQuery(searchItem.searchText, true)
} }
SEARCH_HISTORY_REMOVE -> { SEARCH_HISTORY_REMOVE -> {
removeKey(SEARCH_HISTORY_KEY, searchItem.key) removeKey("$currentAccount/$SEARCH_HISTORY_KEY", searchItem.key)
searchViewModel.updateHistory() searchViewModel.updateHistory()
} }
else -> { else -> {
@ -559,4 +560,4 @@ class SearchFragment : Fragment() {
.commit()*/ .commit()*/
} }
} }