{"action":"created","comment":{"url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/comments/46690960","id":46690960,"diff_hunk":"@@ -44,55 +19,21 @@ window.addEventListener('DOMContentLoaded', function() {\n   var messageArea = document.getElementById('message-container');\n \n   function enableImport() {\n-    var timeEnable;\n-    if (!accessToken || !tokenValidity) {\n-      timeEnable = -1\n-    } else {\n-      timeEnable = tokenValidity - Date.now();\n-    }\n-\n-    if (timeEnable > 0) {\n-      importButton.style.display = '';\n-      authorizeButton.querySelector('div[data-l10n-id]').dataset.l10nId =\n-        'reauthorize';\n+    importButton.style.display = '';\n+    authorizeButton.querySelector('div[data-l10n-id]').dataset.l10nId =\n+      'reauthorize';\n+    navigator.mozL10n.ready(() => {\n       navigator.mozL10n.translate(authorizeButton);\n-      setTimeout(disableImport, timeEnable);\n-    } else {\n-      disableImport();\n-    }\n+    });","path":"js/app.js","position":64,"original_position":64,"commit_id":"7d8ecb0549c4ad726f5f5264b7365724a7b24dc0","original_commit_id":"ead321245e8e29a05c73bd4ebf8407d03d27d968","user":{"login":"fabi1cazenave","id":457778,"avatar_url":"https://avatars.githubusercontent.com/u/457778?v=3","gravatar_id":"","url":"https://api.github.com/users/fabi1cazenave","html_url":"https://github.com/fabi1cazenave","followers_url":"https://api.github.com/users/fabi1cazenave/followers","following_url":"https://api.github.com/users/fabi1cazenave/following{/other_user}","gists_url":"https://api.github.com/users/fabi1cazenave/gists{/gist_id}","starred_url":"https://api.github.com/users/fabi1cazenave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabi1cazenave/subscriptions","organizations_url":"https://api.github.com/users/fabi1cazenave/orgs","repos_url":"https://api.github.com/users/fabi1cazenave/repos","events_url":"https://api.github.com/users/fabi1cazenave/events{/privacy}","received_events_url":"https://api.github.com/users/fabi1cazenave/received_events","type":"User","site_admin":false},"body":"Setting the data-l10n-id in the JS feels wrong, and it makes the initialization really painful. So yeah, I’d prefer two elements (or two spans within the same button + a class, whatever works).","created_at":"2015-12-04T15:10:45Z","updated_at":"2015-12-04T15:10:45Z","html_url":"https://github.com/Phoxygen/fxos-google-contacts-sync/pull/22#discussion_r46690960","pull_request_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/comments/46690960"},"html":{"href":"https://github.com/Phoxygen/fxos-google-contacts-sync/pull/22#discussion_r46690960"},"pull_request":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22","id":51996160,"html_url":"https://github.com/Phoxygen/fxos-google-contacts-sync/pull/22","diff_url":"https://github.com/Phoxygen/fxos-google-contacts-sync/pull/22.diff","patch_url":"https://github.com/Phoxygen/fxos-google-contacts-sync/pull/22.patch","issue_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/22","number":22,"state":"open","locked":false,"title":"Extract oauth_manager from app.js","user":{"login":"autra","id":1576598,"avatar_url":"https://avatars.githubusercontent.com/u/1576598?v=3","gravatar_id":"","url":"https://api.github.com/users/autra","html_url":"https://github.com/autra","followers_url":"https://api.github.com/users/autra/followers","following_url":"https://api.github.com/users/autra/following{/other_user}","gists_url":"https://api.github.com/users/autra/gists{/gist_id}","starred_url":"https://api.github.com/users/autra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autra/subscriptions","organizations_url":"https://api.github.com/users/autra/orgs","repos_url":"https://api.github.com/users/autra/repos","events_url":"https://api.github.com/users/autra/events{/privacy}","received_events_url":"https://api.github.com/users/autra/received_events","type":"User","site_admin":false},"body":"This commit introduces the OauthManager, which manage the oauth process and exposes a promise-based API to start it and get results.\r\n\r\n@fabi1cazenave this commits attempts at making things clearer and have a better separation-of-concern in this app. Please R?","created_at":"2015-11-27T13:43:46Z","updated_at":"2015-12-04T15:10:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4fee59d8be19bcdd95c0e80c631462fa1c53429","assignee":{"login":"fabi1cazenave","id":457778,"avatar_url":"https://avatars.githubusercontent.com/u/457778?v=3","gravatar_id":"","url":"https://api.github.com/users/fabi1cazenave","html_url":"https://github.com/fabi1cazenave","followers_url":"https://api.github.com/users/fabi1cazenave/followers","following_url":"https://api.github.com/users/fabi1cazenave/following{/other_user}","gists_url":"https://api.github.com/users/fabi1cazenave/gists{/gist_id}","starred_url":"https://api.github.com/users/fabi1cazenave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabi1cazenave/subscriptions","organizations_url":"https://api.github.com/users/fabi1cazenave/orgs","repos_url":"https://api.github.com/users/fabi1cazenave/repos","events_url":"https://api.github.com/users/fabi1cazenave/events{/privacy}","received_events_url":"https://api.github.com/users/fabi1cazenave/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22/commits","review_comments_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22/comments","review_comment_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/22/comments","statuses_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/statuses/7d8ecb0549c4ad726f5f5264b7365724a7b24dc0","head":{"label":"Phoxygen:extract_oauth_manager","ref":"extract_oauth_manager","sha":"7d8ecb0549c4ad726f5f5264b7365724a7b24dc0","user":{"login":"Phoxygen","id":10355929,"avatar_url":"https://avatars.githubusercontent.com/u/10355929?v=3","gravatar_id":"","url":"https://api.github.com/users/Phoxygen","html_url":"https://github.com/Phoxygen","followers_url":"https://api.github.com/users/Phoxygen/followers","following_url":"https://api.github.com/users/Phoxygen/following{/other_user}","gists_url":"https://api.github.com/users/Phoxygen/gists{/gist_id}","starred_url":"https://api.github.com/users/Phoxygen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phoxygen/subscriptions","organizations_url":"https://api.github.com/users/Phoxygen/orgs","repos_url":"https://api.github.com/users/Phoxygen/repos","events_url":"https://api.github.com/users/Phoxygen/events{/privacy}","received_events_url":"https://api.github.com/users/Phoxygen/received_events","type":"Organization","site_admin":false},"repo":{"id":45930529,"name":"fxos-google-contacts-sync","full_name":"Phoxygen/fxos-google-contacts-sync","owner":{"login":"Phoxygen","id":10355929,"avatar_url":"https://avatars.githubusercontent.com/u/10355929?v=3","gravatar_id":"","url":"https://api.github.com/users/Phoxygen","html_url":"https://github.com/Phoxygen","followers_url":"https://api.github.com/users/Phoxygen/followers","following_url":"https://api.github.com/users/Phoxygen/following{/other_user}","gists_url":"https://api.github.com/users/Phoxygen/gists{/gist_id}","starred_url":"https://api.github.com/users/Phoxygen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phoxygen/subscriptions","organizations_url":"https://api.github.com/users/Phoxygen/orgs","repos_url":"https://api.github.com/users/Phoxygen/repos","events_url":"https://api.github.com/users/Phoxygen/events{/privacy}","received_events_url":"https://api.github.com/users/Phoxygen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Phoxygen/fxos-google-contacts-sync","description":"A privileged app to sync google contacts to Firefox OS devices.","fork":false,"url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync","forks_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/forks","keys_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/teams","hooks_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/hooks","issue_events_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/events{/number}","events_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/events","assignees_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/assignees{/user}","branches_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/branches{/branch}","tags_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/tags","blobs_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/refs{/sha}","trees_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/statuses/{sha}","languages_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/languages","stargazers_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/stargazers","contributors_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/contributors","subscribers_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/subscribers","subscription_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/subscription","commits_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/commits{/sha}","git_commits_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/commits{/sha}","comments_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/comments{/number}","issue_comment_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/comments{/number}","contents_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/contents/{+path}","compare_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/merges","archive_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/downloads","issues_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues{/number}","pulls_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls{/number}","milestones_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/milestones{/number}","notifications_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/labels{/name}","releases_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/releases{/id}","created_at":"2015-11-10T18:05:07Z","updated_at":"2015-11-27T09:30:26Z","pushed_at":"2015-12-01T14:16:47Z","git_url":"git://github.com/Phoxygen/fxos-google-contacts-sync.git","ssh_url":"git@github.com:Phoxygen/fxos-google-contacts-sync.git","clone_url":"https://github.com/Phoxygen/fxos-google-contacts-sync.git","svn_url":"https://github.com/Phoxygen/fxos-google-contacts-sync","homepage":null,"size":983,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"Phoxygen:master","ref":"master","sha":"a751837326f695ed745ddd536d91b68daa4844bb","user":{"login":"Phoxygen","id":10355929,"avatar_url":"https://avatars.githubusercontent.com/u/10355929?v=3","gravatar_id":"","url":"https://api.github.com/users/Phoxygen","html_url":"https://github.com/Phoxygen","followers_url":"https://api.github.com/users/Phoxygen/followers","following_url":"https://api.github.com/users/Phoxygen/following{/other_user}","gists_url":"https://api.github.com/users/Phoxygen/gists{/gist_id}","starred_url":"https://api.github.com/users/Phoxygen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phoxygen/subscriptions","organizations_url":"https://api.github.com/users/Phoxygen/orgs","repos_url":"https://api.github.com/users/Phoxygen/repos","events_url":"https://api.github.com/users/Phoxygen/events{/privacy}","received_events_url":"https://api.github.com/users/Phoxygen/received_events","type":"Organization","site_admin":false},"repo":{"id":45930529,"name":"fxos-google-contacts-sync","full_name":"Phoxygen/fxos-google-contacts-sync","owner":{"login":"Phoxygen","id":10355929,"avatar_url":"https://avatars.githubusercontent.com/u/10355929?v=3","gravatar_id":"","url":"https://api.github.com/users/Phoxygen","html_url":"https://github.com/Phoxygen","followers_url":"https://api.github.com/users/Phoxygen/followers","following_url":"https://api.github.com/users/Phoxygen/following{/other_user}","gists_url":"https://api.github.com/users/Phoxygen/gists{/gist_id}","starred_url":"https://api.github.com/users/Phoxygen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phoxygen/subscriptions","organizations_url":"https://api.github.com/users/Phoxygen/orgs","repos_url":"https://api.github.com/users/Phoxygen/repos","events_url":"https://api.github.com/users/Phoxygen/events{/privacy}","received_events_url":"https://api.github.com/users/Phoxygen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Phoxygen/fxos-google-contacts-sync","description":"A privileged app to sync google contacts to Firefox OS devices.","fork":false,"url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync","forks_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/forks","keys_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/teams","hooks_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/hooks","issue_events_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/events{/number}","events_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/events","assignees_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/assignees{/user}","branches_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/branches{/branch}","tags_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/tags","blobs_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/refs{/sha}","trees_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/statuses/{sha}","languages_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/languages","stargazers_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/stargazers","contributors_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/contributors","subscribers_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/subscribers","subscription_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/subscription","commits_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/commits{/sha}","git_commits_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/git/commits{/sha}","comments_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/comments{/number}","issue_comment_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/comments{/number}","contents_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/contents/{+path}","compare_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/merges","archive_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/downloads","issues_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues{/number}","pulls_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls{/number}","milestones_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/milestones{/number}","notifications_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/labels{/name}","releases_url":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/releases{/id}","created_at":"2015-11-10T18:05:07Z","updated_at":"2015-11-27T09:30:26Z","pushed_at":"2015-12-01T14:16:47Z","git_url":"git://github.com/Phoxygen/fxos-google-contacts-sync.git","ssh_url":"git@github.com:Phoxygen/fxos-google-contacts-sync.git","clone_url":"https://github.com/Phoxygen/fxos-google-contacts-sync.git","svn_url":"https://github.com/Phoxygen/fxos-google-contacts-sync","homepage":null,"size":983,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22"},"html":{"href":"https://github.com/Phoxygen/fxos-google-contacts-sync/pull/22"},"issue":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/22"},"comments":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/Phoxygen/fxos-google-contacts-sync/statuses/7d8ecb0549c4ad726f5f5264b7365724a7b24dc0"}}}}