Skip to content

Commit

Permalink
Remove useless vars
Browse files Browse the repository at this point in the history
ofekby committed Nov 22, 2023
1 parent 1134625 commit 1cc622b
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Tabnine/src/main/java/com/tabnine/chat/ChatEnabledState.kt
Original file line number Diff line number Diff line change
@@ -47,9 +47,7 @@ class ChatEnabledState private constructor() : ChatFrame.UseChatEnabledState,
val chatCapabilityEnabled =
CapabilitiesService.getInstance().isCapabilityEnabled(Capability.TABNINE_CHAT)

val enabled = isLoggedIn && (alphaEnabled || chatCapabilityEnabled)

if (enabled) {
if (isLoggedIn && (alphaEnabled || chatCapabilityEnabled)) {
set(ChatState.enabled())
} else if (!isLoggedIn) {
set(ChatState.disabled(ChatDisabledReason.AUTHENTICATION_REQUIRED))
Original file line number Diff line number Diff line change
@@ -32,9 +32,7 @@ class ChatEnabledState private constructor() : ChatFrame.UseChatEnabledState,
return
}

val enabled = userInfo.team != null

if (enabled) {
if (userInfo.team != null) {
set(ChatState.enabled())
} else if (!userInfo.isLoggedIn) {
set(ChatState.disabled(ChatDisabledReason.AUTHENTICATION_REQUIRED))

0 comments on commit 1cc622b

Please sign in to comment.