Browse Source

Do not delete downloads on authentication error (prepare for new authentication system).

housekeeping/remove-warnings
Antoine POPINEAU 4 years ago
parent
commit
998dab0fb5
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
  1. 7
      app/src/main/java/com/github/apognu/otter/activities/MainActivity.kt
  2. 3
      app/src/main/java/com/github/apognu/otter/activities/SplashActivity.kt

7
app/src/main/java/com/github/apognu/otter/activities/MainActivity.kt

@ -20,6 +20,7 @@ import androidx.fragment.app.DialogFragment @@ -20,6 +20,7 @@ import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.lifecycleScope
import com.github.apognu.otter.Otter
import com.github.apognu.otter.R
import com.github.apognu.otter.fragments.*
import com.github.apognu.otter.playback.MediaControlsManager
@ -191,6 +192,8 @@ class MainActivity : AppCompatActivity() { @@ -191,6 +192,8 @@ class MainActivity : AppCompatActivity() {
if (resultCode == ResultCode.LOGOUT.code) {
Intent(this, LoginActivity::class.java).apply {
Otter.get().deleteAllData()
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
stopService(Intent(this@MainActivity, PlayerService::class.java))
@ -227,9 +230,7 @@ class MainActivity : AppCompatActivity() { @@ -227,9 +230,7 @@ class MainActivity : AppCompatActivity() {
EventBus.get().collect { message ->
when (message) {
is Event.LogOut -> {
PowerPreference.clearAllData()
cacheDir.deleteRecursively()
Otter.get().deleteAllData()
startActivity(Intent(this@MainActivity, LoginActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NO_HISTORY

3
app/src/main/java/com/github/apognu/otter/activities/SplashActivity.kt

@ -4,6 +4,7 @@ import android.content.Context @@ -4,6 +4,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.github.apognu.otter.Otter
import com.github.apognu.otter.utils.AppContext
import com.github.apognu.otter.utils.Settings
@ -20,6 +21,8 @@ class SplashActivity : AppCompatActivity() { @@ -20,6 +21,8 @@ class SplashActivity : AppCompatActivity() {
}
false -> Intent(this@SplashActivity, LoginActivity::class.java).apply {
Otter.get().deleteAllData()
flags = Intent.FLAG_ACTIVITY_NO_ANIMATION
startActivity(this)

Loading…
Cancel
Save