From 7889ab1ea6eeb820b2f9338c5fcb391cc80a385d Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Mon, 16 Sep 2024 15:12:25 +0900 Subject: [PATCH] =?UTF-8?q?[FIX/#241]=20=ED=85=8D=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=ED=95=84=EB=93=9C=20=EC=A1=B0=EA=B1=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/mypage/profileedit/ProfileEditViewModel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt index 118230e2..34067761 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt @@ -53,14 +53,14 @@ class ProfileEditViewModel @Inject constructor( } fun updateProfile(profile: String) { - val isSameAsInitial = profile == _state.value.initialProfile + val isProfileModified = profile != _state.value.initialProfile _state.value = _state.value.copy( profile = profile, - initialView = false, - isModified = if (profile == _state.value.profile) _state.value.isModified else !isSameAsInitial, + initialView = if (isProfileModified) false else _state.value.initialView, + isModified = if (isProfileModified) true else _state.value.isModified, isProfileChangedButNameSame = if (_state.value.isNameChangedOnce) false - else state.value.name == _state.value.initialName + else _state.value.name == _state.value.initialName ) }