mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Lambda parameters in a composable function should be in present tense, not past tense.
https://mrmans0n.github.io/compose-rules/rules/#naming-parameters-properly
This commit is contained in:
+6
-6
@@ -36,8 +36,8 @@ fun CrashDetectionView(
|
||||
if (state.crashDetected) {
|
||||
CrashDetectionContent(
|
||||
appName = state.appName,
|
||||
onYesClicked = onOpenBugReport,
|
||||
onNoClicked = ::onPopupDismissed,
|
||||
onYesClick = onOpenBugReport,
|
||||
onNoClick = ::onPopupDismissed,
|
||||
onDismiss = ::onPopupDismissed,
|
||||
)
|
||||
}
|
||||
@@ -46,8 +46,8 @@ fun CrashDetectionView(
|
||||
@Composable
|
||||
private fun CrashDetectionContent(
|
||||
appName: String,
|
||||
onNoClicked: () -> Unit = { },
|
||||
onYesClicked: () -> Unit = { },
|
||||
onNoClick: () -> Unit = { },
|
||||
onYesClick: () -> Unit = { },
|
||||
onDismiss: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
@@ -55,8 +55,8 @@ private fun CrashDetectionContent(
|
||||
content = stringResource(id = R.string.crash_detection_dialog_content, appName),
|
||||
submitText = stringResource(id = CommonStrings.action_yes),
|
||||
cancelText = stringResource(id = CommonStrings.action_no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
onCancelClick = onNoClick,
|
||||
onSubmitClick = onYesClick,
|
||||
onDismiss = onDismiss,
|
||||
)
|
||||
}
|
||||
|
||||
+14
-14
@@ -50,16 +50,16 @@ fun RageshakeDetectionView(
|
||||
}
|
||||
when {
|
||||
state.takeScreenshot -> TakeScreenshot(
|
||||
onScreenshotTaken = { eventSink(RageshakeDetectionEvents.ProcessScreenshot(it)) }
|
||||
onScreenshot = { eventSink(RageshakeDetectionEvents.ProcessScreenshot(it)) }
|
||||
)
|
||||
state.showDialog -> {
|
||||
LaunchedEffect(Unit) {
|
||||
context.vibrate()
|
||||
}
|
||||
RageshakeDialogContent(
|
||||
onNoClicked = { eventSink(RageshakeDetectionEvents.Dismiss) },
|
||||
onDisableClicked = { eventSink(RageshakeDetectionEvents.Disable) },
|
||||
onYesClicked = onOpenBugReport
|
||||
onNoClick = { eventSink(RageshakeDetectionEvents.Dismiss) },
|
||||
onDisableClick = { eventSink(RageshakeDetectionEvents.Disable) },
|
||||
onYesClick = onOpenBugReport
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -67,22 +67,22 @@ fun RageshakeDetectionView(
|
||||
|
||||
@Composable
|
||||
private fun TakeScreenshot(
|
||||
onScreenshotTaken: (ImageResult) -> Unit
|
||||
onScreenshot: (ImageResult) -> Unit
|
||||
) {
|
||||
val view = LocalView.current
|
||||
val latestOnScreenshotTaken by rememberUpdatedState(onScreenshotTaken)
|
||||
val latestOnScreenshot by rememberUpdatedState(onScreenshot)
|
||||
LaunchedEffect(Unit) {
|
||||
view.screenshot {
|
||||
latestOnScreenshotTaken(it)
|
||||
latestOnScreenshot(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun RageshakeDialogContent(
|
||||
onNoClicked: () -> Unit = { },
|
||||
onDisableClicked: () -> Unit = { },
|
||||
onYesClicked: () -> Unit = { },
|
||||
onNoClick: () -> Unit = { },
|
||||
onDisableClick: () -> Unit = { },
|
||||
onYesClick: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
title = stringResource(id = CommonStrings.action_report_bug),
|
||||
@@ -90,10 +90,10 @@ private fun RageshakeDialogContent(
|
||||
thirdButtonText = stringResource(id = CommonStrings.action_disable),
|
||||
submitText = stringResource(id = CommonStrings.action_yes),
|
||||
cancelText = stringResource(id = CommonStrings.action_no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onThirdButtonClicked = onDisableClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
onDismiss = onNoClicked,
|
||||
onCancelClick = onNoClick,
|
||||
onThirdButtonClick = onDisableClick,
|
||||
onSubmitClick = onYesClick,
|
||||
onDismiss = onNoClick,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user