no rpc in offline mode

This commit is contained in:
aayush262 2024-01-31 10:41:21 +05:30
parent 1f98e349dc
commit c853d5bdf8
4 changed files with 20 additions and 22 deletions

View file

@ -1013,9 +1013,9 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
initPlayer()
preloading = false
val context = this
val offline = PrefWrapper.getVal(PrefName.OfflineMode, false)
val incognito = PrefWrapper.getVal(PrefName.Incognito, false)
if (isOnline(context) && Discord.token != null && !incognito) {
if ((isOnline(context) && !offline) && Discord.token != null && !incognito) {
lifecycleScope.launch {
val presence = RPC.createPresence(RPC.Companion.RPCData(
applicationId = Discord.application_Id,

View file

@ -98,8 +98,6 @@ class MangaReaderActivity : AppCompatActivity() {
var sliding = false
var isAnimating = false
private var rpc: RPC? = null
override fun onAttachedToWindow() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && !settings.showSystemBars) {
val displayCutout = window.decorView.rootWindowInsets.displayCutout
@ -320,8 +318,9 @@ class MangaReaderActivity : AppCompatActivity() {
chaptersTitleArr.getOrNull(currentChapterIndex - 1) ?: ""
applySettings()
val context = this
val offline = PrefWrapper.getVal(PrefName.OfflineMode, false)
val incognito = PrefWrapper.getVal(PrefName.Incognito, false)
if (isOnline(context) && Discord.token != null && !incognito) {
if ((isOnline(context) && !offline) && Discord.token != null && !incognito) {
lifecycleScope.launch {
val presence = RPC.createPresence(
RPC.Companion.RPCData(