From 66a453bafd54938dd6cf5e889055b77bd6b2918d Mon Sep 17 00:00:00 2001 From: mathieudutour Date: Mon, 26 Mar 2018 15:15:22 +0200 Subject: [PATCH] Fix a bug where the wrong user account would be used to authenticate --- app/package.json | 2 +- app/src/lib/kactus.ts | 15 ++++++++------- changelog.json | 3 +++ plugin/package.json | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/package.json b/app/package.json index f6694df52..d1dc6922c 100644 --- a/app/package.json +++ b/app/package.json @@ -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", diff --git a/app/src/lib/kactus.ts b/app/src/lib/kactus.ts index cc0f10b6e..8b6f4e251 100644 --- a/app/src/lib/kactus.ts +++ b/app/src/lib/kactus.ts @@ -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) { diff --git a/changelog.json b/changelog.json index ed7f11336..bd35e991e 100644 --- a/changelog.json +++ b/changelog.json @@ -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)" diff --git a/plugin/package.json b/plugin/package.json index f475b8ef1..80573dd2a 100644 --- a/plugin/package.json +++ b/plugin/package.json @@ -1,6 +1,6 @@ { "name": "kactus", - "version": "0.3.3", + "version": "0.3.4", "description": "Kactus plugin", "main": "../out/plugin.sketchplugin", "scripts": {