Skip to content
Snippets Groups Projects
Verified Commit bf1a6b7d authored by Kai DeLorenzo's avatar Kai DeLorenzo :purple_heart:
Browse files

updated URL and catch HTTP errors

parent 77a558db
No related branches found
No related tags found
1 merge request!38Subscription submission modal
......@@ -558,15 +558,19 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
UIDialogs.Action("Cancel", { }, UIDialogs.ActionStyle.NONE),
UIDialogs.Action("Upload", {
GlobalScope.launch(Dispatchers.IO) {
val url = "https://logs.grayjay.app/subscriptions"
val url = "https://data.grayjay.app/donate-subscription-list"
val client = ManagedHttpClient();
val headers = hashMapOf(
"Content-Type" to "application/json"
)
val response = client.post(url, json, headers)
// if it failed retry one time
if (!response.isOk) {
client.post(url, json, headers)
try {
val response = client.post(url, json, headers)
// if it failed retry one time
if (!response.isOk) {
client.post(url, json, headers)
}
} catch (e: Exception) {
Logger.i(TAG, "Failed to submit subscription list.", e)
}
}
}, UIDialogs.ActionStyle.PRIMARY)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment