From 2c85dae785b67241ef72500ac3c43fdff86bbad0 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 24 Jan 2021 20:02:12 -0800 Subject: Revert "Add option to log out for messenger" This reverts commit 4c2c8a9ce4872e8bbb2a55c8b527e4f7b22ef633. --- .../frost/contracts/FrostContentContract.kt | 37 ---------------------- 1 file changed, 37 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt b/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt index a5d4e191..b8d0d86f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt @@ -16,19 +16,11 @@ */ package com.pitchedapps.frost.contracts -import android.content.Context import android.view.View -import ca.allanwang.kau.utils.materialDialog -import com.pitchedapps.frost.R -import com.pitchedapps.frost.db.CookieDao -import com.pitchedapps.frost.db.updateMessengerCookie -import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.facebook.FbItem -import com.pitchedapps.frost.prefs.Prefs import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.BroadcastChannel -import kotlinx.coroutines.launch /** * Created by Allan Wang on 20/12/17. @@ -179,37 +171,8 @@ interface FrostContentCore : DynamicUiContract { */ fun onTabClicked() - /** - * Triggered when view is within viewpager - * and tab is long clicked - */ - fun onTabLongClicked() - /** * Signal destruction to release some content manually */ fun destroy() } - -internal fun FrostContentCore.onTabLongClicked( - context: Context, - prefs: Prefs, - fbCookie: FbCookie, - cookieDao: CookieDao -) { - when (parent.baseEnum) { - FbItem.MESSENGER -> { - context.materialDialog { - message(R.string.messenger_logout) - positiveButton(R.string.kau_logout) { - scope.launch { - fbCookie.removeMessengerCookie() - cookieDao.updateMessengerCookie(prefs.userId, null) - reloadBase(true) - } - } - negativeButton(R.string.kau_cancel) - } - } - } -} -- cgit v1.2.3