mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-27 03:18:24 +01:00
Fix 'Suggested Title' bug (#1120)
- Fixed issue where a post's suggested titles would fail to generate Co-authored-by: Kurian Vithayathil <no.reply@github.com>
This commit is contained in:
parent
1108d41eed
commit
0a18220998
@ -9,6 +9,7 @@ import android.os.Handler;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.webkit.URLUtil;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@ -351,10 +352,10 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
|
||||
suggestTitleButton.setOnClickListener(view -> {
|
||||
Toast.makeText(this, R.string.please_wait, Toast.LENGTH_SHORT).show();
|
||||
String url = linkEditText.getText().toString().trim();
|
||||
if (!url.startsWith("https://") || !url.startsWith("http://")) {
|
||||
if (!URLUtil.isHttpsUrl(url) && !URLUtil.isHttpUrl(url)) {
|
||||
url = "https://" + url;
|
||||
}
|
||||
new Retrofit.Builder()
|
||||
mRetrofit.newBuilder()
|
||||
.baseUrl("http://localhost/")
|
||||
.addConverterFactory(ScalarsConverterFactory.create())
|
||||
.build().create(TitleSuggestion.class).getHtml(url).enqueue(new Callback<String>() {
|
||||
|
Loading…
Reference in New Issue
Block a user