diff --git a/appveyor.yml b/appveyor.yml index 6da3244..789bb7a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.1.0-{build} +version: 1.1.1-{build} clone_folder: c:\gopath\src\github.com\michaelsanford\bittray diff --git a/config/constants.go b/config/constants.go index c876685..44fed74 100644 --- a/config/constants.go +++ b/config/constants.go @@ -4,7 +4,7 @@ var ( // GhAPI is the GitHub URL to the Release API (for update checks) GhAPI = "https://api.github.com/repos/michaelsanford/bittray/releases/latest" // CurrentVersionTag is the git tag of the current version - CurrentVersionTag = "1.1.0" + CurrentVersionTag = "1.1.1" // DocsURL is the GitHub URL to the documentation site DocsURL = "https://michaelsanford.github.io/bittray/" diff --git a/polling/polling.go b/polling/polling.go index 48e5879..ca93bca 100644 --- a/polling/polling.go +++ b/polling/polling.go @@ -39,9 +39,14 @@ func Poll() <-chan int8 { for ; true; <-ticker.C { resp, _ := client.Do(req) - if resp != nil && resp.StatusCode == 200 { - bodyText, _ := ioutil.ReadAll(resp.Body) - items <- int8(gjson.Get(string(bodyText), "size").Uint()) + if resp != nil { + if resp.StatusCode == 200 { + bodyText, _ := ioutil.ReadAll(resp.Body) + items <- int8(gjson.Get(string(bodyText), "size").Uint()) + } else if resp.StatusCode == 401 { + ticker.Stop() + items <- int8(-2) + } } else { items <- int8(-1) } diff --git a/tray/tray.go b/tray/tray.go index 5718ef5..52c1a2c 100644 --- a/tray/tray.go +++ b/tray/tray.go @@ -55,6 +55,11 @@ func onReady() { systray.SetTooltip("Locked") dlgs.Error("Bitbucket Error", "There was a problem contacting the API") } + } else if count == -2 { + systray.SetIcon(icon.Lock) + systray.SetTooltip("Not Authorized") + dlgs.Error("Not Authorized", "Wrong password. Quit and try again!") + systray.Quit() } } }()