mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Show MAL relogin message on update, localize error message
This commit is contained in:
parent
5901978889
commit
2cb3984d68
3 changed files with 8 additions and 2 deletions
|
@ -10,6 +10,7 @@ import eu.kanade.tachiyomi.data.track.TrackManager
|
|||
import eu.kanade.tachiyomi.data.updater.UpdaterJob
|
||||
import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
|
||||
import eu.kanade.tachiyomi.ui.library.LibrarySort
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import eu.kanade.tachiyomi.widget.ExtendedNavigationView
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
@ -118,7 +119,10 @@ object Migrations {
|
|||
|
||||
// Force MAL log out due to login flow change
|
||||
val trackManager = Injekt.get<TrackManager>()
|
||||
if (trackManager.myAnimeList.isLogged) {
|
||||
trackManager.myAnimeList.logout()
|
||||
context.toast(R.string.myanimelist_relogin)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class MyAnimeList(private val context: Context, id: Int) : TrackService(id) {
|
|||
|
||||
fun ensureLoggedIn() {
|
||||
if (isAuthorized) return
|
||||
if (!isLogged) throw Exception("MAL login credentials not found")
|
||||
if (!isLogged) throw Exception(context.getString(R.string.myanimelist_creds_missing))
|
||||
}
|
||||
|
||||
override fun logout() {
|
||||
|
|
|
@ -569,6 +569,8 @@
|
|||
<string name="track_type">Type</string>
|
||||
<string name="track_author">Author</string>
|
||||
<string name="error_invalid_date_supplied">Invalid date supplied</string>
|
||||
<string name="myanimelist_creds_missing">MAL login credentials not found</string>
|
||||
<string name="myanimelist_relogin">Please login to MAL again</string>
|
||||
|
||||
<!-- Category activity -->
|
||||
<string name="error_category_exists">A category with this name already exists!</string>
|
||||
|
|
Loading…
Reference in a new issue