{"action":"created","comment":{"url":"https://api.github.com/repos/wireapp/wire-desktop/pulls/comments/145084147","pull_request_review_id":69829818,"id":145084147,"diff_hunk":"@@ -66,24 +80,51 @@ const Sidebar = ({\n         </div>\n       </div>\n     ))}\n-    {!isAddingAccount && !hasReachedLimitOfAccounts &&\n-      <ContextMenuTrigger id=\"account\">\n-        <div className=\"Sidebar-cell\">\n-          <div data-uie-name=\"do-open-plus-menu\" className=\"Sidebar-account-add\">\n-            <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\">\n-              <path d=\"M0 5.25v1.5h5.25V12h1.5V6.75H12v-1.5H6.75V0h-1.5v5.25\" fillRule=\"evenodd\"/>\n-            </svg>\n-          </div>\n-        </div>\n-      </ContextMenuTrigger>\n-    }\n+    {!isAddingAccount &&\n+      !hasReachedLimitOfAccounts && (\n+        <AddAccountMenuTrigger\n+          id=\"account\"\n+          onClick={preventFocus(event => {\n+            const cRect = event.target.getBoundingClientRect();\n+            connected.toggleAccountContextVisibility(\n+              cRect.left + cRect.width / 2,\n+              cRect.top + cRect.height / 2\n+            );\n+          })}\n+          forceVisible={isContextMenuVisible}\n+        />\n+      )}\n \n     <ContextMenu id=\"account\">\n-      <ContextMenuItem onClick={() => window.open('https://wire.com/create-team/?pk_campaign=client&pk_kwd=desktop')}>\n+      <ContextMenuItem\n+        onClick={() =>\n+          window.open(\n+            'https://wire.com/create-team/?pk_campaign=client&pk_kwd=desktop'\n+          )}\n+      >\n         {getText('wrapperCreateTeam')}\n       </ContextMenuItem>\n-      <ContextMenuItem onClick={() => addAccountWithSession()}>{getText('wrapperAddAccount')}</ContextMenuItem>\n+      <ContextMenuItem onClick={connected.addAccountWithSession}>\n+        {getText('wrapperAddAccount')}\n+      </ContextMenuItem>\n     </ContextMenu>\n-  </div>;\n+  </div>\n+);\n \n-export default Sidebar;\n+export default connect(\n+  ({ accounts, contextMenuState }) => ({\n+    accounts,\n+    currentAccentID: (accounts.find(account => account.visible) || {}).accentID,\n+    hasCreatedAccount: accounts.some(account => account.userID !== undefined),\n+    hasReachedLimitOfAccounts: accounts.length === 3,","path":"electron/renderer/src/components/Sidebar.js","position":135,"original_position":135,"commit_id":"a1a9db15a79273fb04f6e41cdc1a95799c798120","original_commit_id":"a1a9db15a79273fb04f6e41cdc1a95799c798120","user":{"login":"gregor","id":10243309,"avatar_url":"https://avatars1.githubusercontent.com/u/10243309?v=4","gravatar_id":"","url":"https://api.github.com/users/gregor","html_url":"https://github.com/gregor","followers_url":"https://api.github.com/users/gregor/followers","following_url":"https://api.github.com/users/gregor/following{/other_user}","gists_url":"https://api.github.com/users/gregor/gists{/gist_id}","starred_url":"https://api.github.com/users/gregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregor/subscriptions","organizations_url":"https://api.github.com/users/gregor/orgs","repos_url":"https://api.github.com/users/gregor/repos","events_url":"https://api.github.com/users/gregor/events{/privacy}","received_events_url":"https://api.github.com/users/gregor/received_events","type":"User","site_admin":false},"body":"Let's be safer in this case and make sure that if someone managed to create more than three account - however that might be possible (changing the content of the database, etc) - the test still works. => `accounts.length >= 3` ","created_at":"2017-10-17T10:06:42Z","updated_at":"2017-10-17T10:06:42Z","html_url":"https://github.com/wireapp/wire-desktop/pull/1045#discussion_r145084147","pull_request_url":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-desktop/pulls/comments/145084147"},"html":{"href":"https://github.com/wireapp/wire-desktop/pull/1045#discussion_r145084147"},"pull_request":{"href":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045"}}},"pull_request":{"url":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045","id":146820755,"html_url":"https://github.com/wireapp/wire-desktop/pull/1045","diff_url":"https://github.com/wireapp/wire-desktop/pull/1045.diff","patch_url":"https://github.com/wireapp/wire-desktop/pull/1045.patch","issue_url":"https://api.github.com/repos/wireapp/wire-desktop/issues/1045","number":1045,"state":"open","locked":false,"title":"fix: Sidebar context menu behaviour","user":{"login":"Yserz","id":1138344,"avatar_url":"https://avatars2.githubusercontent.com/u/1138344?v=4","gravatar_id":"","url":"https://api.github.com/users/Yserz","html_url":"https://github.com/Yserz","followers_url":"https://api.github.com/users/Yserz/followers","following_url":"https://api.github.com/users/Yserz/following{/other_user}","gists_url":"https://api.github.com/users/Yserz/gists{/gist_id}","starred_url":"https://api.github.com/users/Yserz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yserz/subscriptions","organizations_url":"https://api.github.com/users/Yserz/orgs","repos_url":"https://api.github.com/users/Yserz/repos","events_url":"https://api.github.com/users/Yserz/events{/privacy}","received_events_url":"https://api.github.com/users/Yserz/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-16T15:49:39Z","updated_at":"2017-10-17T10:06:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fac4a205e757dff5eb3da727768438c93b0cfa6f","assignee":{"login":"Yserz","id":1138344,"avatar_url":"https://avatars2.githubusercontent.com/u/1138344?v=4","gravatar_id":"","url":"https://api.github.com/users/Yserz","html_url":"https://github.com/Yserz","followers_url":"https://api.github.com/users/Yserz/followers","following_url":"https://api.github.com/users/Yserz/following{/other_user}","gists_url":"https://api.github.com/users/Yserz/gists{/gist_id}","starred_url":"https://api.github.com/users/Yserz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yserz/subscriptions","organizations_url":"https://api.github.com/users/Yserz/orgs","repos_url":"https://api.github.com/users/Yserz/repos","events_url":"https://api.github.com/users/Yserz/events{/privacy}","received_events_url":"https://api.github.com/users/Yserz/received_events","type":"User","site_admin":false},"assignees":[{"login":"Yserz","id":1138344,"avatar_url":"https://avatars2.githubusercontent.com/u/1138344?v=4","gravatar_id":"","url":"https://api.github.com/users/Yserz","html_url":"https://github.com/Yserz","followers_url":"https://api.github.com/users/Yserz/followers","following_url":"https://api.github.com/users/Yserz/following{/other_user}","gists_url":"https://api.github.com/users/Yserz/gists{/gist_id}","starred_url":"https://api.github.com/users/Yserz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yserz/subscriptions","organizations_url":"https://api.github.com/users/Yserz/orgs","repos_url":"https://api.github.com/users/Yserz/repos","events_url":"https://api.github.com/users/Yserz/events{/privacy}","received_events_url":"https://api.github.com/users/Yserz/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045/commits","review_comments_url":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045/comments","review_comment_url":"https://api.github.com/repos/wireapp/wire-desktop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wireapp/wire-desktop/issues/1045/comments","statuses_url":"https://api.github.com/repos/wireapp/wire-desktop/statuses/a1a9db15a79273fb04f6e41cdc1a95799c798120","head":{"label":"wireapp:sidebar-context-menu-fix","ref":"sidebar-context-menu-fix","sha":"a1a9db15a79273fb04f6e41cdc1a95799c798120","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":64225407,"name":"wire-desktop","full_name":"wireapp/wire-desktop","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-desktop","description":":computer: Wire for Desktop","fork":false,"url":"https://api.github.com/repos/wireapp/wire-desktop","forks_url":"https://api.github.com/repos/wireapp/wire-desktop/forks","keys_url":"https://api.github.com/repos/wireapp/wire-desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-desktop/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-desktop/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-desktop/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-desktop/events","assignees_url":"https://api.github.com/repos/wireapp/wire-desktop/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-desktop/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-desktop/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-desktop/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-desktop/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-desktop/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-desktop/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-desktop/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-desktop/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-desktop/merges","archive_url":"https://api.github.com/repos/wireapp/wire-desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-desktop/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-desktop/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-desktop/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-desktop/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-desktop/deployments","created_at":"2016-07-26T13:55:48Z","updated_at":"2017-10-15T20:58:51Z","pushed_at":"2017-10-17T10:06:14Z","git_url":"git://github.com/wireapp/wire-desktop.git","ssh_url":"git@github.com:wireapp/wire-desktop.git","clone_url":"https://github.com/wireapp/wire-desktop.git","svn_url":"https://github.com/wireapp/wire-desktop","homepage":"https://wire.com/download/","size":1900,"stargazers_count":532,"watchers_count":532,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":43,"forks":97,"open_issues":43,"watchers":532,"default_branch":"master"}},"base":{"label":"wireapp:master","ref":"master","sha":"5121bf58638dd660304025f94ce77be85758016c","user":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":64225407,"name":"wire-desktop","full_name":"wireapp/wire-desktop","owner":{"login":"wireapp","id":16047324,"avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-desktop","description":":computer: Wire for Desktop","fork":false,"url":"https://api.github.com/repos/wireapp/wire-desktop","forks_url":"https://api.github.com/repos/wireapp/wire-desktop/forks","keys_url":"https://api.github.com/repos/wireapp/wire-desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-desktop/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-desktop/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-desktop/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-desktop/events","assignees_url":"https://api.github.com/repos/wireapp/wire-desktop/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-desktop/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-desktop/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-desktop/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-desktop/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-desktop/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-desktop/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-desktop/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-desktop/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-desktop/merges","archive_url":"https://api.github.com/repos/wireapp/wire-desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-desktop/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-desktop/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-desktop/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-desktop/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-desktop/deployments","created_at":"2016-07-26T13:55:48Z","updated_at":"2017-10-15T20:58:51Z","pushed_at":"2017-10-17T10:06:14Z","git_url":"git://github.com/wireapp/wire-desktop.git","ssh_url":"git@github.com:wireapp/wire-desktop.git","clone_url":"https://github.com/wireapp/wire-desktop.git","svn_url":"https://github.com/wireapp/wire-desktop","homepage":"https://wire.com/download/","size":1900,"stargazers_count":532,"watchers_count":532,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":43,"forks":97,"open_issues":43,"watchers":532,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045"},"html":{"href":"https://github.com/wireapp/wire-desktop/pull/1045"},"issue":{"href":"https://api.github.com/repos/wireapp/wire-desktop/issues/1045"},"comments":{"href":"https://api.github.com/repos/wireapp/wire-desktop/issues/1045/comments"},"review_comments":{"href":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045/comments"},"review_comment":{"href":"https://api.github.com/repos/wireapp/wire-desktop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wireapp/wire-desktop/pulls/1045/commits"},"statuses":{"href":"https://api.github.com/repos/wireapp/wire-desktop/statuses/a1a9db15a79273fb04f6e41cdc1a95799c798120"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"gregor"}}