{"action":"created","comment":{"url":"https://api.github.com/repos/brave/browser-laptop/pulls/comments/78017795","id":78017795,"diff_hunk":"@@ -572,81 +578,72 @@ const createMenu = (CommonMenu) => {\n     })\n   }\n \n-  const oldMenu = appMenu\n+  let oldMenu = appMenu\n   appMenu = Menu.buildFromTemplate(template)\n   Menu.setApplicationMenu(appMenu)\n   if (oldMenu) {\n     oldMenu.destroy()\n   }\n }\n \n-const updateMenu = (CommonMenu, appState, windowData) => {\n-  const updated = menuUtil.checkForUpdate(appState, windowData)\n-  if (updated.nothingUpdated) {\n-    return\n-  }\n-\n-  // When bookmarks are removed via AppStore (context menu, etc), `isBookmarkChecked` needs to be recalculated\n-  if (windowData && windowData.get('location')) {\n-    isBookmarkChecked = isSiteBookmarked(appState.get('sites'), Immutable.fromJS({location: windowData.get('location')}))\n-  }\n-\n-  // Only rebuild menus when necessary\n-\n-  if (updated.settings || updated.closedFrames) {\n-    let historyMenu = menuUtil.getParentMenuDetails(appMenu, locale.translation('history'))\n-    if (historyMenu && historyMenu.menu && historyMenu.menu.submenu && historyMenu.index !== -1) {\n-      const menu = historyMenu.menu.submenu\n-      const menuItems = createHistorySubmenu(CommonMenu)\n-      menu.clear()\n-      menuItems.forEach((item) => menu.append(new MenuItem(item)))\n-    }\n-  }\n-\n-  if (updated.sites) {\n-    let bookmarksMenu = menuUtil.getParentMenuDetails(appMenu, locale.translation('bookmarks'))\n-    if (bookmarksMenu && bookmarksMenu.menu && bookmarksMenu.menu.submenu && bookmarksMenu.index !== -1) {\n-      const menu = bookmarksMenu.menu.submenu\n-      const menuItems = createBookmarksSubmenu(CommonMenu)\n-      menu.clear()\n-      menuItems.forEach((item) => menu.append(new MenuItem(item)))\n-    }\n+const doAction = (action) => {\n+  switch (action.actionType) {\n+    case windowConstants.WINDOW_SET_FOCUSED_FRAME:\n+      // TODO check/uncheck menu item instead of recreating menu","path":"app/browser/menu.js","position":217,"original_position":217,"commit_id":"8b0e958f07bbcc5db7651617df8c4e98b705d163","original_commit_id":"8b0e958f07bbcc5db7651617df8c4e98b705d163","user":{"login":"bsclifton","id":4733304,"avatar_url":"https://avatars.githubusercontent.com/u/4733304?v=3","gravatar_id":"","url":"https://api.github.com/users/bsclifton","html_url":"https://github.com/bsclifton","followers_url":"https://api.github.com/users/bsclifton/followers","following_url":"https://api.github.com/users/bsclifton/following{/other_user}","gists_url":"https://api.github.com/users/bsclifton/gists{/gist_id}","starred_url":"https://api.github.com/users/bsclifton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsclifton/subscriptions","organizations_url":"https://api.github.com/users/bsclifton/orgs","repos_url":"https://api.github.com/users/bsclifton/repos","events_url":"https://api.github.com/users/bsclifton/events{/privacy}","received_events_url":"https://api.github.com/users/bsclifton/received_events","type":"User","site_admin":false},"body":"Just a ? about this TODO; we solved it already, right? We fetch the item via getMenuItem and then set the checked status","created_at":"2016-09-08T14:33:09Z","updated_at":"2016-09-08T14:33:09Z","html_url":"https://github.com/brave/browser-laptop/pull/3813#discussion_r78017795","pull_request_url":"https://api.github.com/repos/brave/browser-laptop/pulls/3813","_links":{"self":{"href":"https://api.github.com/repos/brave/browser-laptop/pulls/comments/78017795"},"html":{"href":"https://github.com/brave/browser-laptop/pull/3813#discussion_r78017795"},"pull_request":{"href":"https://api.github.com/repos/brave/browser-laptop/pulls/3813"}}},"pull_request":{"url":"https://api.github.com/repos/brave/browser-laptop/pulls/3813","id":84439251,"html_url":"https://github.com/brave/browser-laptop/pull/3813","diff_url":"https://github.com/brave/browser-laptop/pull/3813.diff","patch_url":"https://github.com/brave/browser-laptop/pull/3813.patch","issue_url":"https://api.github.com/repos/brave/browser-laptop/issues/3813","number":3813,"state":"closed","locked":false,"title":"only update the menu when bookmarks or closed tabs change","user":{"login":"bridiver","id":34129,"avatar_url":"https://avatars.githubusercontent.com/u/34129?v=3","gravatar_id":"","url":"https://api.github.com/users/bridiver","html_url":"https://github.com/bridiver","followers_url":"https://api.github.com/users/bridiver/followers","following_url":"https://api.github.com/users/bridiver/following{/other_user}","gists_url":"https://api.github.com/users/bridiver/gists{/gist_id}","starred_url":"https://api.github.com/users/bridiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bridiver/subscriptions","organizations_url":"https://api.github.com/users/bridiver/orgs","repos_url":"https://api.github.com/users/bridiver/repos","events_url":"https://api.github.com/users/bridiver/events{/privacy}","received_events_url":"https://api.github.com/users/bridiver/received_events","type":"User","site_admin":false},"body":"- [x] Submitted a [ticket](https://github.com/brave/browser-laptop/issues) for my issue if one did not already exist.\r\n- [x] Used Github [auto-closing keywords](https://help.github.com/articles/closing-issues-via-commit-messages/) in the commit message.\r\n- [x] Added/updated tests for this change (for new code or code which already has tests).\r\n- [x] Ran `git rebase -i` to squash commits (if needed).\r\n\r\nTest Plan:\r\nAdd bookmark\r\n1. Go to brave.com\r\n2. Add bookmark\r\n3. Bookmark should appear in menu\r\n\r\nBookmark indicator\r\n1. Open a new tab\r\n2. Bookmark indicator should not be activated\r\n3. Bookmarks menu \"Bookmark this page\" should not be checked\r\n4. Go back to brave.com tab\r\n5. Bookmark indicator should be active\r\n6. Bookmarks menu \"Bookmark this page\" should be checked\r\n\r\nLast closed Frame\r\n1. Close the brave.com tab\r\n2. History menu should show brave.com under recently closed\r\n\r\nLanguage\r\n1. Change language\r\n2. Restart Brave\r\n3. Text should be translated by language setting\r\n4. Change back and restart Brave\r\n5. Text should be translated by language setting\r\n\r\nState\r\n1. Open brave.com\r\n2. Close Brave\r\n3. Reopen Brave and cnn.com tab should be loaded\r\n\r\nFix #3782","created_at":"2016-09-08T09:01:55Z","updated_at":"2016-09-08T14:33:09Z","closed_at":"2016-09-08T13:40:38Z","merged_at":"2016-09-08T13:40:38Z","merge_commit_sha":"12c204fef9525197b9735e290d22376059e3fb06","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/brave/browser-laptop/pulls/3813/commits","review_comments_url":"https://api.github.com/repos/brave/browser-laptop/pulls/3813/comments","review_comment_url":"https://api.github.com/repos/brave/browser-laptop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brave/browser-laptop/issues/3813/comments","statuses_url":"https://api.github.com/repos/brave/browser-laptop/statuses/8b0e958f07bbcc5db7651617df8c4e98b705d163","head":{"label":"brave:menu-updates","ref":"menu-updates","sha":"8b0e958f07bbcc5db7651617df8c4e98b705d163","user":{"login":"brave","id":12301619,"avatar_url":"https://avatars.githubusercontent.com/u/12301619?v=3","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"repo":{"id":46891997,"name":"browser-laptop","full_name":"brave/browser-laptop","owner":{"login":"brave","id":12301619,"avatar_url":"https://avatars.githubusercontent.com/u/12301619?v=3","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brave/browser-laptop","description":"Brave browser for Desktop and Laptop computers running Windows, OSX, and Linux","fork":false,"url":"https://api.github.com/repos/brave/browser-laptop","forks_url":"https://api.github.com/repos/brave/browser-laptop/forks","keys_url":"https://api.github.com/repos/brave/browser-laptop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brave/browser-laptop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brave/browser-laptop/teams","hooks_url":"https://api.github.com/repos/brave/browser-laptop/hooks","issue_events_url":"https://api.github.com/repos/brave/browser-laptop/issues/events{/number}","events_url":"https://api.github.com/repos/brave/browser-laptop/events","assignees_url":"https://api.github.com/repos/brave/browser-laptop/assignees{/user}","branches_url":"https://api.github.com/repos/brave/browser-laptop/branches{/branch}","tags_url":"https://api.github.com/repos/brave/browser-laptop/tags","blobs_url":"https://api.github.com/repos/brave/browser-laptop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brave/browser-laptop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brave/browser-laptop/git/refs{/sha}","trees_url":"https://api.github.com/repos/brave/browser-laptop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brave/browser-laptop/statuses/{sha}","languages_url":"https://api.github.com/repos/brave/browser-laptop/languages","stargazers_url":"https://api.github.com/repos/brave/browser-laptop/stargazers","contributors_url":"https://api.github.com/repos/brave/browser-laptop/contributors","subscribers_url":"https://api.github.com/repos/brave/browser-laptop/subscribers","subscription_url":"https://api.github.com/repos/brave/browser-laptop/subscription","commits_url":"https://api.github.com/repos/brave/browser-laptop/commits{/sha}","git_commits_url":"https://api.github.com/repos/brave/browser-laptop/git/commits{/sha}","comments_url":"https://api.github.com/repos/brave/browser-laptop/comments{/number}","issue_comment_url":"https://api.github.com/repos/brave/browser-laptop/issues/comments{/number}","contents_url":"https://api.github.com/repos/brave/browser-laptop/contents/{+path}","compare_url":"https://api.github.com/repos/brave/browser-laptop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brave/browser-laptop/merges","archive_url":"https://api.github.com/repos/brave/browser-laptop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brave/browser-laptop/downloads","issues_url":"https://api.github.com/repos/brave/browser-laptop/issues{/number}","pulls_url":"https://api.github.com/repos/brave/browser-laptop/pulls{/number}","milestones_url":"https://api.github.com/repos/brave/browser-laptop/milestones{/number}","notifications_url":"https://api.github.com/repos/brave/browser-laptop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brave/browser-laptop/labels{/name}","releases_url":"https://api.github.com/repos/brave/browser-laptop/releases{/id}","deployments_url":"https://api.github.com/repos/brave/browser-laptop/deployments","created_at":"2015-11-25T22:55:10Z","updated_at":"2016-09-08T14:15:21Z","pushed_at":"2016-09-08T13:49:13Z","git_url":"git://github.com/brave/browser-laptop.git","ssh_url":"git@github.com:brave/browser-laptop.git","clone_url":"https://github.com/brave/browser-laptop.git","svn_url":"https://github.com/brave/browser-laptop","homepage":"https://www.brave.com","size":30720,"stargazers_count":3363,"watchers_count":3363,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":385,"mirror_url":null,"open_issues_count":1080,"forks":385,"open_issues":1080,"watchers":3363,"default_branch":"master"}},"base":{"label":"brave:master","ref":"master","sha":"7edc0ce9c9079c9b8f165fa0a6add38abc827de8","user":{"login":"brave","id":12301619,"avatar_url":"https://avatars.githubusercontent.com/u/12301619?v=3","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"repo":{"id":46891997,"name":"browser-laptop","full_name":"brave/browser-laptop","owner":{"login":"brave","id":12301619,"avatar_url":"https://avatars.githubusercontent.com/u/12301619?v=3","gravatar_id":"","url":"https://api.github.com/users/brave","html_url":"https://github.com/brave","followers_url":"https://api.github.com/users/brave/followers","following_url":"https://api.github.com/users/brave/following{/other_user}","gists_url":"https://api.github.com/users/brave/gists{/gist_id}","starred_url":"https://api.github.com/users/brave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brave/subscriptions","organizations_url":"https://api.github.com/users/brave/orgs","repos_url":"https://api.github.com/users/brave/repos","events_url":"https://api.github.com/users/brave/events{/privacy}","received_events_url":"https://api.github.com/users/brave/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brave/browser-laptop","description":"Brave browser for Desktop and Laptop computers running Windows, OSX, and Linux","fork":false,"url":"https://api.github.com/repos/brave/browser-laptop","forks_url":"https://api.github.com/repos/brave/browser-laptop/forks","keys_url":"https://api.github.com/repos/brave/browser-laptop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brave/browser-laptop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brave/browser-laptop/teams","hooks_url":"https://api.github.com/repos/brave/browser-laptop/hooks","issue_events_url":"https://api.github.com/repos/brave/browser-laptop/issues/events{/number}","events_url":"https://api.github.com/repos/brave/browser-laptop/events","assignees_url":"https://api.github.com/repos/brave/browser-laptop/assignees{/user}","branches_url":"https://api.github.com/repos/brave/browser-laptop/branches{/branch}","tags_url":"https://api.github.com/repos/brave/browser-laptop/tags","blobs_url":"https://api.github.com/repos/brave/browser-laptop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brave/browser-laptop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brave/browser-laptop/git/refs{/sha}","trees_url":"https://api.github.com/repos/brave/browser-laptop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brave/browser-laptop/statuses/{sha}","languages_url":"https://api.github.com/repos/brave/browser-laptop/languages","stargazers_url":"https://api.github.com/repos/brave/browser-laptop/stargazers","contributors_url":"https://api.github.com/repos/brave/browser-laptop/contributors","subscribers_url":"https://api.github.com/repos/brave/browser-laptop/subscribers","subscription_url":"https://api.github.com/repos/brave/browser-laptop/subscription","commits_url":"https://api.github.com/repos/brave/browser-laptop/commits{/sha}","git_commits_url":"https://api.github.com/repos/brave/browser-laptop/git/commits{/sha}","comments_url":"https://api.github.com/repos/brave/browser-laptop/comments{/number}","issue_comment_url":"https://api.github.com/repos/brave/browser-laptop/issues/comments{/number}","contents_url":"https://api.github.com/repos/brave/browser-laptop/contents/{+path}","compare_url":"https://api.github.com/repos/brave/browser-laptop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brave/browser-laptop/merges","archive_url":"https://api.github.com/repos/brave/browser-laptop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brave/browser-laptop/downloads","issues_url":"https://api.github.com/repos/brave/browser-laptop/issues{/number}","pulls_url":"https://api.github.com/repos/brave/browser-laptop/pulls{/number}","milestones_url":"https://api.github.com/repos/brave/browser-laptop/milestones{/number}","notifications_url":"https://api.github.com/repos/brave/browser-laptop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brave/browser-laptop/labels{/name}","releases_url":"https://api.github.com/repos/brave/browser-laptop/releases{/id}","deployments_url":"https://api.github.com/repos/brave/browser-laptop/deployments","created_at":"2015-11-25T22:55:10Z","updated_at":"2016-09-08T14:15:21Z","pushed_at":"2016-09-08T13:49:13Z","git_url":"git://github.com/brave/browser-laptop.git","ssh_url":"git@github.com:brave/browser-laptop.git","clone_url":"https://github.com/brave/browser-laptop.git","svn_url":"https://github.com/brave/browser-laptop","homepage":"https://www.brave.com","size":30720,"stargazers_count":3363,"watchers_count":3363,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":385,"mirror_url":null,"open_issues_count":1080,"forks":385,"open_issues":1080,"watchers":3363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brave/browser-laptop/pulls/3813"},"html":{"href":"https://github.com/brave/browser-laptop/pull/3813"},"issue":{"href":"https://api.github.com/repos/brave/browser-laptop/issues/3813"},"comments":{"href":"https://api.github.com/repos/brave/browser-laptop/issues/3813/comments"},"review_comments":{"href":"https://api.github.com/repos/brave/browser-laptop/pulls/3813/comments"},"review_comment":{"href":"https://api.github.com/repos/brave/browser-laptop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brave/browser-laptop/pulls/3813/commits"},"statuses":{"href":"https://api.github.com/repos/brave/browser-laptop/statuses/8b0e958f07bbcc5db7651617df8c4e98b705d163"}}}}
{"actor":{"display_login":"bsclifton"}}