Skip to content

Commit

Permalink
Merge pull request #237 from team-xquare/feature/229-save-login
Browse files Browse the repository at this point in the history
🔀 :: (#236) Feature/229 save login state
  • Loading branch information
rladmsdh authored Sep 15, 2023
2 parents 05efe10 + 1ae1a79 commit f500e66
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
12 changes: 0 additions & 12 deletions app/src/main/java/com/xquare/xquare_android/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,6 @@ fun getToken(context: Context): String? {
return token
}

// 캐시 메모리 삭제
fun clearCache(context: Context) {
val cacheDir = context.cacheDir
if (cacheDir.isDirectory) {
val children = cacheDir.list()
for (i in children!!.indices) {
File(cacheDir, children[i]).delete()
}
}
}


fun Context.getActivity(): ComponentActivity? = when (this) {
is ComponentActivity -> this
is ContextWrapper -> baseContext.getActivity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ class XquareApplication : Application() {
super.onCreate()
AndroidThreeTen.init(this)
FirebaseApp.initializeApp(this)

val sharedPrefs = getSharedPreferences("token", Context.MODE_PRIVATE)
// 데이터 모두 삭제
sharedPrefs.edit().clear().apply()
saveDeviceToken(this)
clearCache(this)
}
}

0 comments on commit f500e66

Please sign in to comment.