From 5c1c97efa1498e48991499f46d3de3350b806863 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 20 Feb 2023 09:32:04 +0100 Subject: [PATCH] when resuming note directly after creating, url is not working anymore, thus we need a new one Signed-off-by: tobiasKaminsky --- .../android/ui/activity/TextEditorWebView.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/TextEditorWebView.kt b/app/src/main/java/com/owncloud/android/ui/activity/TextEditorWebView.kt index f61953b42f..b05365dd9f 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/TextEditorWebView.kt +++ b/app/src/main/java/com/owncloud/android/ui/activity/TextEditorWebView.kt @@ -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?) {