when resuming note directly after creating, url is not working anymore, thus we need a new one

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2023-02-20 09:32:04 +01:00
parent dfc9193b15
commit 5c1c97efa1
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

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?) {