-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/mz 199 마이페이지 - 내정보 편집, 앱 버전, 개인정보처리방침 #91
Conversation
if (packageInfo != null) { | ||
return packageInfo.versionName | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packageInfo는 non-null 아닌가용??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 맞네요
긁어오고 확인 안한거 딱 걸렸네요 머슥
private fun getAppVersion(context: Context): String { | ||
try { | ||
val packageInfo = context.packageManager.getPackageInfo( | ||
context.packageName, 0, | ||
) | ||
|
||
if (packageInfo != null) { | ||
return packageInfo.versionName | ||
} | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
} | ||
return "" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private fun getAppVersion(context: Context): String { | |
try { | |
val packageInfo = context.packageManager.getPackageInfo( | |
context.packageName, 0, | |
) | |
if (packageInfo != null) { | |
return packageInfo.versionName | |
} | |
} catch (e: Exception) { | |
e.printStackTrace() | |
} | |
return "" | |
} | |
private fun getAppVersion(context: Context): String = runCatching { | |
val packageInfo = context.packageManager.getPackageInfo( | |
context.packageName, 0, | |
) | |
packageInfo.versionName | |
}.getOrNull() ?: "" |
모든 예외를 catch 할거면 runCatching이 더 가독성이 좋을거같아요
또 이 함수는 리컴포지션이 발생할 때마다 실행되서 별로인거같습니다. remember 쓰는거 어때요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개인정보처리방침까지 포함시켰습니다! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
💡 Issue
🌱 Key changes
✅ To Reviewers
개인정보처리방침은 노션 웹뷰 이슈로 추후 따로 작업 예정📸 스크린샷
-.mp4