feat: crash report | various small fixes

This commit is contained in:
rebelonion 2024-05-01 14:45:08 -05:00
parent 31c509f88c
commit 8a0224e6b0
12 changed files with 250 additions and 88 deletions

View file

@ -38,6 +38,7 @@ import logcat.LogPriority
import logcat.LogcatLogger
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.lang.IllegalStateException
@SuppressLint("StaticFieldLeak")
@ -124,11 +125,16 @@ class App : MultiDexApplication() {
downloadAddonManager = Injekt.get()
torrentAddonManager.init()
downloadAddonManager.init()
CommentsAPI.fetchAuthToken()
CommentsAPI.fetchAuthToken(this@App)
val useAlarmManager = PrefManager.getVal<Boolean>(PrefName.UseAlarmManager)
val scheduler = TaskScheduler.create(this@App, useAlarmManager)
scheduler.scheduleAllTasks(this@App)
try {
scheduler.scheduleAllTasks(this@App)
} catch (e: IllegalStateException) {
Logger.log("Failed to schedule tasks")
Logger.log(e)
}
}
}
@ -159,7 +165,7 @@ class App : MultiDexApplication() {
}
companion object {
private var instance: App? = null
var instance: App? = null
/** Reference to the application context.
*