File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
app/src/main/java/com/lagradost/quicknovel Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -318,11 +318,11 @@ class RoyalRoadProvider : MainAPI() {
318318 }
319319 }
320320
321- override suspend fun load (url : String ): LoadResponse ? {
321+ override suspend fun load (url : String ): LoadResponse {
322322 val response = app.get(url)
323323 val document = response.document
324324 val name = document.selectFirst(" h1.font-white" )?.text()
325- ? : throw ErrorLoadingException (" Null name " )
325+ ? : throw ErrorLoadingException (" Name not found for ' $url ' \n might be deleted or simply a malformed url " )
326326 val fictionId =
327327 response.text.substringAfter(" window.fictionId = " ).substringBefore(" ;" ).toIntOrNull()
328328
Original file line number Diff line number Diff line change @@ -365,16 +365,15 @@ class ResultFragment : Fragment() {
365365 viewModel.openInBrowser()
366366 }
367367
368+ resultReloadConnectionOpenInBrowser.setOnClickListener {
369+ viewModel.openInBrowser()
370+ }
371+
368372 reviewsFab.setOnClickListener {
369373 resultReviews.smoothScrollToPosition(0 ) // NEEDS THIS TO RESET VELOCITY
370374 resultMainscroll.smoothScrollTo(0 , 0 )
371375 }
372376
373- resultOpeninbrower.setOnClickListener {
374- viewModel.openInBrowser()
375- }
376-
377-
378377 val backParameter = resultBack.layoutParams as CoordinatorLayout .LayoutParams
379378 backParameter.setMargins(
380379 backParameter.leftMargin,
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import com.lagradost.quicknovel.util.ResultCached
4343import kotlinx.coroutines.launch
4444import kotlinx.coroutines.sync.Mutex
4545import kotlinx.coroutines.sync.withLock
46+ import androidx.core.net.toUri
4647
4748class ResultViewModel : ViewModel () {
4849 fun clear () {
@@ -145,7 +146,7 @@ class ResultViewModel : ViewModel() {
145146 loadMutex.withLock {
146147 if (loadUrl.isBlank()) return @launch
147148 val i = Intent (Intent .ACTION_VIEW )
148- i.data = Uri .parse(loadUrl )
149+ i.data = loadUrl.toUri( )
149150 activity?.startActivity(i)
150151 }
151152 }
You can’t perform that action at this time.
0 commit comments