Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Remove button instead of hiding it
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Apr 25, 2018
1 parent 6e8bb4d commit 9915026
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/service/slack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class SlackService extends Service {
}

loginWithToken(token, button) {
button.setTitle("Loading...")
if (button)
button.setTitle("Loading...")
else
this.loginWindow.setContentView(gui.Label.create('Loading...'))
const rtm = new RTMClient(token)
require('./private-apis').extend(rtm)
rtm.once('unable_to_rtm_start', (error) => {
Expand All @@ -39,9 +42,12 @@ class SlackService extends Service {
})
rtm.once('authenticated', (data) => {
new SlackAccount(this, data, rtm)
button.setVisible(false)
this.adujstLoginWindowSize()

if (button) {
this.loginWindow.getContentView().removeChildView(button)
this.adujstLoginWindowSize()
} else {
this.loginWindow.close()
}
})
rtm.start({batch_presence_aware: true})
}
Expand Down

0 comments on commit 9915026

Please sign in to comment.