From 1622b707dfd71cf8132abde204d6fdad2b03f9d0 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Wed, 28 Aug 2024 15:20:24 +0200 Subject: [PATCH] Fix invalid API url on non discord activity hosts --- .../kotlin/dev/schlaubi/tonbrett/app/api/Authentication.kt | 4 +++- build.gradle.kts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/shared/src/jsMain/kotlin/dev/schlaubi/tonbrett/app/api/Authentication.kt b/app/shared/src/jsMain/kotlin/dev/schlaubi/tonbrett/app/api/Authentication.kt index 0fa9a35..bce147a 100644 --- a/app/shared/src/jsMain/kotlin/dev/schlaubi/tonbrett/app/api/Authentication.kt +++ b/app/shared/src/jsMain/kotlin/dev/schlaubi/tonbrett/app/api/Authentication.kt @@ -34,5 +34,7 @@ actual open class AppContext : AppContextBase() { } actual fun getUrl() = URLBuilder(window.location.href).apply { - takeFrom("https://$appId.discordsays.com/.proxy/api/") + if (window.location.host.endsWith("discordsays.com")) { + takeFrom("https://$appId.discordsays.com/.proxy/api/") + } }.build() diff --git a/build.gradle.kts b/build.gradle.kts index 08a4dc7..a210de7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { allprojects { group = "dev.schlaubi.tonbrett" - version = "1.21.0" + version = "1.21.1" repositories { mavenCentral()