Skip to content

Commit

Permalink
Fix a bug where the wrong user account would be used to authenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieudutour committed Mar 26, 2018
1 parent 5b59d42 commit 66a453b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Kactus",
"bundleID": "io.kactus.KactusClient",
"companyName": "Kactus.io",
"version": "0.3.3",
"version": "0.3.4",
"main": "./main.js",
"repository": {
"type": "git",
Expand Down
15 changes: 8 additions & 7 deletions app/src/lib/kactus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,16 @@ export function shouldShowPremiumUpsell(
return false
}

let potentialPremiumAccount: Account | undefined
let potentialPremiumAccount =
accounts.find(a => a.unlockedEnterpriseKactus) ||
accounts.find(a => a.unlockedKactus)

if (account instanceof Account) {
if (!potentialPremiumAccount && account instanceof Account) {
potentialPremiumAccount = account
} else {
potentialPremiumAccount =
accounts.find(a => a.unlockedEnterpriseKactus) ||
accounts.find(a => a.unlockedKactus) ||
accounts[0]
}

if (!potentialPremiumAccount) {
potentialPremiumAccount = accounts[0]
}

if (repository.gitHubRepository) {
Expand Down
3 changes: 3 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"unreleased": [],
"releases": {
"0.3.4": [
"[Fixed] Fix a bug where the wrong user account would be used to authenticate"
],
"0.3.3": [
"[Improved] Faster Kactus status (finding the Sketch files)",
"[Improved] Faster Git status (finding the changed files)"
Expand Down
2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kactus",
"version": "0.3.3",
"version": "0.3.4",
"description": "Kactus plugin",
"main": "../out/plugin.sketchplugin",
"scripts": {
Expand Down

0 comments on commit 66a453b

Please sign in to comment.