mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 20:38:40 +00:00
Rename parameter to event for code consistency
This commit is contained in:
+3
-3
@@ -56,10 +56,10 @@ class DependencyLicensesListPresenter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvent(dependencyLicensesListEvent: DependencyLicensesListEvent) {
|
fun handleEvent(event: DependencyLicensesListEvent) {
|
||||||
when (dependencyLicensesListEvent) {
|
when (event) {
|
||||||
is DependencyLicensesListEvent.SetFilter -> {
|
is DependencyLicensesListEvent.SetFilter -> {
|
||||||
filter = dependencyLicensesListEvent.filter
|
filter = event.filter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -141,8 +141,8 @@ class AttachmentsPreviewPresenter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleEvent(attachmentsPreviewEvents: AttachmentsPreviewEvents) {
|
fun handleEvent(event: AttachmentsPreviewEvents) {
|
||||||
when (attachmentsPreviewEvents) {
|
when (event) {
|
||||||
is AttachmentsPreviewEvents.SendAttachment -> {
|
is AttachmentsPreviewEvents.SendAttachment -> {
|
||||||
ongoingSendAttachmentJob.value = coroutineScope.launch {
|
ongoingSendAttachmentJob.value = coroutineScope.launch {
|
||||||
// If the media optimization selector is displayed, we need to wait for the user to select the options
|
// If the media optimization selector is displayed, we need to wait for the user to select the options
|
||||||
|
|||||||
+5
-5
@@ -24,16 +24,16 @@ class LinkPresenter(
|
|||||||
override fun present(): LinkState {
|
override fun present(): LinkState {
|
||||||
val linkClick: MutableState<AsyncAction<Link>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
val linkClick: MutableState<AsyncAction<Link>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||||
|
|
||||||
fun handleEvent(linkEvents: LinkEvents) {
|
fun handleEvent(event: LinkEvents) {
|
||||||
when (linkEvents) {
|
when (event) {
|
||||||
is LinkEvents.OnLinkClick -> {
|
is LinkEvents.OnLinkClick -> {
|
||||||
linkClick.value = AsyncAction.Loading
|
linkClick.value = AsyncAction.Loading
|
||||||
val result = linkChecker.isSafe(linkEvents.link)
|
val result = linkChecker.isSafe(event.link)
|
||||||
if (result) {
|
if (result) {
|
||||||
linkClick.value = AsyncAction.Success(linkEvents.link)
|
linkClick.value = AsyncAction.Success(event.link)
|
||||||
} else {
|
} else {
|
||||||
// Confirm first
|
// Confirm first
|
||||||
linkClick.value = ConfirmingLinkClick(linkEvents.link)
|
linkClick.value = ConfirmingLinkClick(event.link)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LinkEvents.Confirm -> {
|
LinkEvents.Confirm -> {
|
||||||
|
|||||||
+2
-2
@@ -17,8 +17,8 @@ import io.element.android.libraries.permissions.api.aPermissionsState
|
|||||||
class FakePermissionsPresenter(
|
class FakePermissionsPresenter(
|
||||||
private val initialState: PermissionsState = aPermissionsState(showDialog = false),
|
private val initialState: PermissionsState = aPermissionsState(showDialog = false),
|
||||||
) : PermissionsPresenter {
|
) : PermissionsPresenter {
|
||||||
private fun handleEvent(events: PermissionsEvents) {
|
private fun handleEvent(event: PermissionsEvents) {
|
||||||
when (events) {
|
when (event) {
|
||||||
PermissionsEvents.RequestPermissions -> state.value = state.value.copy(showDialog = true, permissionAlreadyAsked = true)
|
PermissionsEvents.RequestPermissions -> state.value = state.value.copy(showDialog = true, permissionAlreadyAsked = true)
|
||||||
PermissionsEvents.CloseDialog -> state.value = state.value.copy(showDialog = false)
|
PermissionsEvents.CloseDialog -> state.value = state.value.copy(showDialog = false)
|
||||||
PermissionsEvents.OpenSystemSettingAndCloseDialog -> state.value = state.value.copy(showDialog = false)
|
PermissionsEvents.OpenSystemSettingAndCloseDialog -> state.value = state.value.copy(showDialog = false)
|
||||||
|
|||||||
Reference in New Issue
Block a user