aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-30 12:55:56 -0400
committerGitHub <noreply@github.com>2017-08-30 12:55:56 -0400
commit270ff7705be5ec0c78f5eae4934779ff4b4c00ee (patch)
treefb0ba3e117e138391ac268bc8116e97140e6f436 /app/src/main/kotlin/com/pitchedapps/frost/web
parenta854dcc471078f4e21916730abb5d5d75dd7b03c (diff)
downloadfrost-270ff7705be5ec0c78f5eae4934779ff4b4c00ee.tar.gz
frost-270ff7705be5ec0c78f5eae4934779ff4b4c00ee.tar.bz2
frost-270ff7705be5ec0c78f5eae4934779ff4b4c00ee.zip
fix/searchview (#239)
* Keep searchview even if headless response fails * Keep searchview even if headless response fails * Update changelog and add search tests * Update kau and remove tests * Remove duplicate dispose calls
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/SearchWebView.kt12
2 files changed, 6 insertions, 8 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
index 34022c25..4936eaf4 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
@@ -23,7 +23,7 @@ private val blankResource: WebResourceResponse by lazy { WebResourceResponse("te
//these hosts will redirect to a blank resource
private val blacklistHost: Set<String> =
setOf(
-// "edge-chat.facebook.com"
+// "edge-chat.facebook.com" //todo make more specific? This is required for message responses
)
//these hosts will return null and skip logging
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/SearchWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/SearchWebView.kt
index dc2bd8af..16d9f4bf 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/SearchWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/SearchWebView.kt
@@ -11,7 +11,6 @@ import com.pitchedapps.frost.facebook.USER_AGENT_BASIC
import com.pitchedapps.frost.injectors.JsAssets
import com.pitchedapps.frost.injectors.JsBuilder
import com.pitchedapps.frost.utils.L
-import com.pitchedapps.frost.utils.Prefs
import io.reactivex.schedulers.Schedulers
import io.reactivex.subjects.PublishSubject
import org.jetbrains.anko.runOnUiThread
@@ -118,13 +117,12 @@ class SearchWebView(context: Context, val contract: SearchContract) : WebView(co
fun emit(flag: Int) {
when (flag) {
0 -> {
- L.d("Search loaded successfully")
+ L.i("Search loaded successfully")
}
1 -> { //something is not found in the search view; this is effectively useless
- L.e("Search subject error; reverting to full overlay")
- Prefs.searchBar = false
- searchSubject.onComplete()
- contract.searchOverlayDispose()
+ L.e("Search subject error")
+ dispose()
+ contract.disposeHeadlessSearch()
}
2 -> {
L.v("Search emission received")
@@ -141,7 +139,7 @@ class SearchWebView(context: Context, val contract: SearchContract) : WebView(co
}
interface SearchContract {
- fun searchOverlayDispose()
+ fun disposeHeadlessSearch()
fun emitSearchResponse(items: List<SearchItem>)
val isSearchOpened: Boolean
}