Skip to content

Commit

Permalink
Opening FAQ in app
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed May 30, 2024
1 parent 98cd791 commit 88f9761
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,12 @@ class HomeActivity :
launchQrCode()
true
}
// TCHAP new faq entry
// TCHAP new faq entry.
// the FAQ url is detected as a permalink (same prefix), which make the application fail to open it from
// ChromeCustomTab, so we open it here directly in a WebView
R.id.menu_home_faq -> {
openUrlInChromeCustomTab(this, null, VectorSettingsUrls.HELP)
val intent = VectorWebViewActivity.getIntent(this, VectorSettingsUrls.HELP, getString(R.string.preference_help))
startActivity(intent)
true
}
else -> false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import im.vector.app.core.utils.openUrlInChromeCustomTab
import im.vector.app.features.VectorFeatures
import im.vector.app.features.analytics.plan.MobileScreen
import im.vector.app.features.displayname.getBestName
import im.vector.app.features.webview.VectorWebViewActivity
import org.matrix.android.sdk.api.session.getUserOrDefault
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
Expand Down Expand Up @@ -54,7 +55,8 @@ class VectorSettingsRootFragment :
findPreference<VectorPreference>(VectorPreferences.SETTINGS_HELP_PREFERENCE_KEY)!!
.onPreferenceClickListener = Preference.OnPreferenceClickListener {
if (firstThrottler.canHandle() is FirstThrottler.CanHandlerResult.Yes) {
openUrlInChromeCustomTab(requireContext(), null, VectorSettingsUrls.HELP)
val intent = VectorWebViewActivity.getIntent(requireContext(), VectorSettingsUrls.HELP, getString(R.string.preference_help))
startActivity(intent)
}
false
}
Expand Down

0 comments on commit 88f9761

Please sign in to comment.