no presence when not signed in

This commit is contained in:
Finnley Somdahl 2023-12-05 00:25:37 -06:00
parent 34a3e9e5a3
commit ea83b722a6
2 changed files with 40 additions and 31 deletions

View file

@ -124,7 +124,7 @@ class MangaReaderActivity : AppCompatActivity() {
override fun onDestroy() {
mangaCache.clear()
if (isOnline(baseContext)) { //TODO:
if (DiscordServiceRunningSingleton.running) {
DiscordServiceRunningSingleton.running = false
val stopIntent = Intent(this, DiscordService::class.java)
stopService(stopIntent)
@ -329,7 +329,7 @@ class MangaReaderActivity : AppCompatActivity() {
chaptersTitleArr.getOrNull(currentChapterIndex - 1) ?: ""
applySettings()
val context = this
if (isOnline(context)) {
if (isOnline(context) && Discord.token != null) {
lifecycleScope.launch {
val presence = RPC.createPresence(
RPC.Companion.RPCData(