Cleanup
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.element.android.appnav.root
|
||||
|
||||
sealed interface RootEvents
|
||||
@@ -32,13 +32,9 @@ class RootPresenter @Inject constructor(
|
||||
val rageshakeDetectionState = rageshakeDetectionPresenter.present()
|
||||
val crashDetectionState = crashDetectionPresenter.present()
|
||||
|
||||
fun handleEvent(@Suppress("UNUSED_PARAMETER") event: RootEvents) {
|
||||
}
|
||||
|
||||
return RootState(
|
||||
rageshakeDetectionState = rageshakeDetectionState,
|
||||
crashDetectionState = crashDetectionState,
|
||||
eventSink = ::handleEvent
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,5 +24,4 @@ import io.element.android.features.rageshake.api.detection.RageshakeDetectionSta
|
||||
data class RootState(
|
||||
val rageshakeDetectionState: RageshakeDetectionState,
|
||||
val crashDetectionState: CrashDetectionState,
|
||||
val eventSink: (RootEvents) -> Unit
|
||||
)
|
||||
|
||||
@@ -37,5 +37,4 @@ open class RootStateProvider : PreviewParameterProvider<RootState> {
|
||||
fun aRootState() = RootState(
|
||||
rageshakeDetectionState = aRageshakeDetectionState(),
|
||||
crashDetectionState = aCrashDetectionState(),
|
||||
eventSink = {}
|
||||
)
|
||||
|
||||
@@ -45,7 +45,6 @@ fun RootView(
|
||||
contentAlignment = Alignment.TopCenter,
|
||||
) {
|
||||
children()
|
||||
val eventSink = state.eventSink
|
||||
|
||||
fun onOpenBugReport() {
|
||||
state.crashDetectionState.eventSink(CrashDetectionEvents.ResetAppHasCrashed)
|
||||
|
||||
Reference in New Issue
Block a user