aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/fragments
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-12-29 21:54:15 -0800
committerGitHub <noreply@github.com>2019-12-29 21:54:15 -0800
commit86df98094d202701690d597024558ccaa6d41abd (patch)
tree41bd58c12f5fe6b1b7df52b0bb1d42613441c107 /app/src/main/kotlin/com/pitchedapps/frost/fragments
parent692c1233cd3dba0d2df06dc65ebef1fc1ecc1cad (diff)
downloadfrost-86df98094d202701690d597024558ccaa6d41abd.tar.gz
frost-86df98094d202701690d597024558ccaa6d41abd.tar.bz2
frost-86df98094d202701690d597024558ccaa6d41abd.zip
Fix townhall loading (#1603)
* Fix townhall loading * Clean up logs * Remove extra imports * Optimize imports * Fix query test
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/fragments')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt
index 0a3884ff..a6b4eae7 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt
@@ -60,4 +60,20 @@ class WebFragment : BaseFragment() {
}
super.updateFab(contract)
}
+
+ override fun onBackPressed(): Boolean {
+ if (baseEnum == FbItem.MENU) {
+ val core = core
+ val web = core as? WebView
+ if (web != null && web.canGoBack() && !web.canGoBackOrForward(-2)) {
+ // If menu item + we are at the second last entry, reload the base
+ // To properly inflate the menu
+ // Related to https://github.com/AllanWang/Frost-for-Facebook/issues/1593
+ core.clearHistory()
+ core.reloadBase(true)
+ return true
+ }
+ }
+ return super.onBackPressed()
+ }
}