Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Console update: Ignore failing images (#709)

Rich Turner897196e48438
diff --git a/console/android/GenericApp/build.gradle b/console/android/GenericApp/build.gradle
index 12a12f33c..7f7e152db 100644
--- a/console/android/GenericApp/build.gradle
+++ b/console/android/GenericApp/build.gradle
@@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.1.1'
+ classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
@@ -23,4 +23,4 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
-}
\ No newline at end of file
+}
diff --git a/console/android/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt b/console/android/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt
index dee0ccc76..de8c52c3e 100644
--- a/console/android/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt
+++ b/console/android/ORLib/src/main/java/io/openremote/orlib/ui/OrMainActivity.kt
@@ -31,6 +31,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.firebase.messaging.FirebaseMessaging
import io.openremote.orlib.ORConstants
+import io.openremote.orlib.ORConstants.BASE_URL_KEY
import io.openremote.orlib.R
import io.openremote.orlib.databinding.ActivityOrMainBinding
import io.openremote.orlib.models.ORAppConfig
@@ -141,9 +142,9 @@ open class OrMainActivity : Activity() {
ORAppConfig::class.java
)
}
-
- if (intent.hasExtra(ORConstants.BASE_URL_KEY)) {
- baseUrl = intent.getStringExtra(ORConstants.BASE_URL_KEY)
+
+ if (intent.hasExtra(BASE_URL_KEY)) {
+ baseUrl = intent.getStringExtra(BASE_URL_KEY)
}
if (appConfig == null) {
@@ -506,7 +507,14 @@ open class OrMainActivity : Activity() {
failingUrl: String?
) {
LOG.warning("Error requesting '$failingUrl': $errorCode($description)")
-
+ //TODO should we always ignore image errors?
+ if (failingUrl != null && (failingUrl.endsWith("png")
+ || failingUrl.endsWith("jpg")
+ || failingUrl.endsWith("ico"))
+ ) {
+ LOG.info("Ignoring error loading image resource")
+ return
+ }
//TODO should we always ignore image errors and locale json files?
if (failingUrl != null && (failingUrl.endsWith("png")
|| failingUrl.endsWith("jpg")