Add search history preference (#193)

This commit is contained in:
Brahim Hadriche authored and GitHub committed 2023-11-06 18:07:21 -05:00
1 parent 91be37fd8a
commit 4c32243e6e
13 files changed
+78 -19

No files matched your search

@@ -0,0 +1,18 @@
import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
end function
function OnNodeReady()
OnSearchHistoryPreference()
m.preferences.observeFieldScoped("search_history.enabled", FuncName(OnSearchHistoryPreference))
end function
function OnSearchHistoryPreference() as void
seachHistoryEnabled = m.preferences["search_history.enabled"]
if seachHistoryEnabled
return
end if
SearchHistoryUtils.Clear()
end function