aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
index 9f203970..c256b674 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
@@ -41,7 +41,7 @@ open class WebOverlayActivity : AppCompatActivity(),
}
open val url: String
- get() = intent.extras!!.getString(ARG_URL).formattedFbUrl
+ get() = (intent.extras?.getString(ARG_URL) ?: intent.dataString).formattedFbUrl
val userId: Long
get() = intent.extras?.getLong(ARG_USER_ID, Prefs.userId) ?: Prefs.userId
@@ -61,7 +61,7 @@ open class WebOverlayActivity : AppCompatActivity(),
setFrostColors(toolbar, themeWindow = false)
coordinator.setBackgroundColor(Prefs.bgColor.withAlpha(255))
- frostWeb.web.setupWebview(url)
+ frostWeb.setupWebview(url)
frostWeb.web.addTitleListener({ toolbar.title = it })
if (userId != Prefs.userId) FbCookie.switchUser(userId) { frostWeb.web.loadBaseUrl() }
else frostWeb.web.loadBaseUrl()
@@ -80,7 +80,7 @@ open class WebOverlayActivity : AppCompatActivity(),
*/
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
- val newUrl = intent.extras!!.getString(ARG_URL).formattedFbUrl
+ val newUrl = (intent.extras?.getString(ARG_URL) ?: intent.dataString).formattedFbUrl
L.d("New intent")
if (url != newUrl) {
this.intent = intent