Skip to content

Commit 79cc04c

Browse files
committed
tackle review issues
1 parent ca747dd commit 79cc04c

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

app/src/main/java/org/schabi/newpipe/error/ErrorReportHelper.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ object ErrorReportHelper {
4848
.value("user_comment", comment)
4949
.end()
5050
.done()
51-
} catch (e: Exception) {
52-
Log.e(TAG, "Could not build json", e)
51+
} catch (exception: Exception) {
52+
Log.e(TAG, "Could not build json", exception)
5353
}
5454
return ""
5555
}
@@ -95,8 +95,8 @@ object ErrorReportHelper {
9595

9696
append("<hr>\n")
9797
}
98-
} catch (e: Exception) {
99-
Log.e(TAG, "Could not build markdown", e)
98+
} catch (exception: Exception) {
99+
Log.e(TAG, "Could not build markdown", exception)
100100
return ""
101101
}
102102
}

app/src/main/java/org/schabi/newpipe/navigation/NavDisplay.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package org.schabi.newpipe.navigation
77

8-
import android.content.Intent
98
import androidx.activity.compose.LocalActivity
109
import androidx.compose.material3.Text
1110
import androidx.compose.runtime.Composable
@@ -20,7 +19,6 @@ import androidx.navigation3.runtime.rememberNavBackStack
2019
import androidx.navigation3.runtime.rememberSaveableStateHolderNavEntryDecorator
2120
import androidx.navigation3.ui.NavDisplay
2221
import org.schabi.newpipe.ComposeActivity
23-
import org.schabi.newpipe.MainActivity
2422
import org.schabi.newpipe.R
2523
import org.schabi.newpipe.error.ErrorInfo
2624
import org.schabi.newpipe.error.ErrorReportHelper
@@ -45,18 +43,7 @@ fun NavDisplay(startDestination: NavKey) {
4543
if (backstack.size > 1) {
4644
backstack.removeLastOrNull()
4745
} else {
48-
// If this is the last screen in the backstack and there's no parent task,
49-
// navigate to MainActivity so the user lands on the home screen.
50-
activity?.let {
51-
if (it.isTaskRoot) {
52-
it.startActivity(
53-
Intent(it, MainActivity::class.java).apply {
54-
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
55-
}
56-
)
57-
}
58-
it.finish()
59-
}
46+
activity?.finish()
6047
}
6148
}
6249

app/src/main/java/org/schabi/newpipe/ui/screens/ErrorReportScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ import org.schabi.newpipe.ui.components.common.ScaffoldWithToolbar
4848
import org.schabi.newpipe.ui.theme.AppTheme
4949
import org.schabi.newpipe.util.Localization
5050

51+
private const val ACTION_EMAIL = "EMAIL"
52+
private const val ACTION_GITHUB = "GITHUB"
53+
5154
sealed interface ErrorReportEvent {
5255
data class ReportViaEmail(val comment: String) : ErrorReportEvent
5356
data class CopyForGitHub(val comment: String) : ErrorReportEvent
@@ -73,9 +76,6 @@ fun ErrorReportScreen(
7376
)
7477
}
7578

76-
private const val ACTION_EMAIL = "EMAIL"
77-
private const val ACTION_GITHUB = "GITHUB"
78-
7979
@Composable
8080
private fun ErrorReportContent(
8181
errorMessage: String,

0 commit comments

Comments
 (0)