Merge pull request #11402 from nextcloud/loadNotes

when resuming note directly after creating, url is not working anymore, thus we need a new one
This commit is contained in:
Tobias Kaminsky 2023-04-13 14:43:01 +02:00 committed by GitHub
commit 10034e6bf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,24 +60,24 @@ class TextEditorWebView : EditorWebView() {
val editor = editorUtils.getEditor(user.get(), file.mimeType)
if (editor != null && editor.id == "onlyoffice") {
getWebView().settings.userAgentString = generateOnlyOfficeUserAgent()
webView.settings.userAgentString = generateOnlyOfficeUserAgent()
}
getWebView().addJavascriptInterface(MobileInterface(), "DirectEditingMobileInterface")
webView.addJavascriptInterface(MobileInterface(), "DirectEditingMobileInterface")
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK_STRATEGY)) {
WebSettingsCompat.setForceDarkStrategy(
getWebView().settings,
webView.settings,
WebSettingsCompat.DARK_STRATEGY_WEB_THEME_DARKENING_ONLY
)
}
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK) && PlatformThemeUtil.isDarkMode(this)) {
WebSettingsCompat.setForceDark(getWebView().settings, WebSettingsCompat.FORCE_DARK_ON)
WebSettingsCompat.setForceDark(webView.settings, WebSettingsCompat.FORCE_DARK_ON)
}
getWebView().setDownloadListener { url, _, _, _, _ -> downloadFile(Uri.parse(url)) }
webView.setDownloadListener { url, _, _, _, _ -> downloadFile(Uri.parse(url)) }
loadUrl(intent.getStringExtra(ExternalSiteWebView.EXTRA_URL))
loadUrl(null)
}
override fun loadUrl(url: String?) {