From 8d0410d961af3d58af3f268c818a051141b7d2c7 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 24 Feb 2022 15:38:36 +0100 Subject: [PATCH] Removes Global doNothing function --- .../lib/core/utils/extensions/Global.kt | 20 ------------------- .../onboarding/ftueauth/FtueAuthVariant.kt | 7 ++----- 2 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 library/core-utils/src/main/java/im/vector/lib/core/utils/extensions/Global.kt diff --git a/library/core-utils/src/main/java/im/vector/lib/core/utils/extensions/Global.kt b/library/core-utils/src/main/java/im/vector/lib/core/utils/extensions/Global.kt deleted file mode 100644 index 3b508ab7b2..0000000000 --- a/library/core-utils/src/main/java/im/vector/lib/core/utils/extensions/Global.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 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 im.vector.lib.core.utils.extensions - -@Suppress("UNUSED_PARAMETER") -fun doNothing(reason: String = "") = Unit diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt index 2083d936be..2b1ada0906 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthVariant.kt @@ -53,7 +53,6 @@ import im.vector.app.features.onboarding.OnboardingViewModel import im.vector.app.features.onboarding.OnboardingViewState import im.vector.app.features.onboarding.ftueauth.terms.FtueAuthTermsFragment import im.vector.app.features.onboarding.ftueauth.terms.FtueAuthTermsFragmentArgument -import im.vector.lib.core.utils.extensions.doNothing import org.matrix.android.sdk.api.auth.registration.FlowResult import org.matrix.android.sdk.api.auth.registration.Stage import org.matrix.android.sdk.api.extensions.tryOrNull @@ -133,9 +132,7 @@ class FtueAuthVariant( viewState.isLoading() || viewState.isAuthTaskCompleted() } - override fun setIsLoading(isLoading: Boolean) { - doNothing() - } + override fun setIsLoading(isLoading: Boolean) = Unit private fun handleOnboardingViewEvents(viewEvents: OnboardingViewEvents) { when (viewEvents) { @@ -285,7 +282,7 @@ class FtueAuthVariant( // state.signMode could not be ready yet. So use value from the ViewEvent when (OnboardingViewEvents.signMode) { SignMode.Unknown -> error("Sign mode has to be set before calling this method") - SignMode.SignUp -> doNothing("This is managed by the OnboardingViewEvents") + SignMode.SignUp -> Unit // This case is processed in handleOnboardingViewEvents SignMode.SignIn -> handleSignInSelected(state) SignMode.SignInWithMatrixId -> handleSignInWithMatrixId(state) }.exhaustive