Widget: fix terms not presented

This commit is contained in:
ganfra 2020-06-19 20:35:29 +02:00
parent 0135368328
commit ba0823f4d0

View File

@ -25,6 +25,7 @@ import im.vector.matrix.android.api.session.widgets.WidgetManagementFailure
import im.vector.matrix.android.internal.session.widgets.WidgetsAPI
import im.vector.matrix.android.internal.session.widgets.WidgetsAPIProvider
import im.vector.matrix.android.internal.task.Task
import timber.log.Timber
import javax.inject.Inject
import javax.net.ssl.HttpsURLConnection
@ -67,8 +68,7 @@ internal class DefaultGetScalarTokenTask @Inject constructor(private val widgets
throw IllegalStateException("Scalar token is null")
}
scalarTokenStore.setToken(serverUrl, registerWidgetResponse.scalarToken)
widgetsAPI.validateToken(registerWidgetResponse.scalarToken, WIDGET_API_VERSION)
return registerWidgetResponse.scalarToken
return validateToken(widgetsAPI,serverUrl, registerWidgetResponse.scalarToken)
}
private suspend fun validateToken(widgetsAPI: WidgetsAPI, serverUrl: String, scalarToken: String): String {