GitHub PullRequestReviewCommentEvent at 2014-01-17 19:06:12
Repository: gaia
Actor: rwaldron
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/8976358","id":8976358,"diff_hunk":"@@ -332,22 +332,23 @@ var MessageManager = {\n           // hashchanges from #group-view back to #thread=n\n           // are considered \"in thread\" and should not\n           // trigger a complete re-rendering of the messages\n-          // in the thread.\n+          // or draft in the thread.\n           if (!ThreadUI.inThread) {\n             ThreadUI.inThread = true;\n+\n+            // Render messages\n             ThreadUI.renderMessages(threadId);\n-          }\n-          // Ensures fromDraft is always called after\n-          // ThreadUI.cleanFields as MessageManager.slide is async\n-          var draft = MessageManager.draft;\n-          var thread = Threads.get(threadId);\n-\n-          if (!draft && thread.hasDrafts) {\n-            draft = thread.drafts.latest;\n-            MessageManager.draft = draft;\n-          }\n \n-          Compose.fromDraft(draft);\n+            // Populate draft if there is one\n+            var thread = Threads.get(threadId);\n+            if (thread.hasDrafts) {\n+              MessageManager.draft = thread.drafts.latest;\n+              Compose.fromDraft(MessageManager.draft);\n+            } else {\n+              MessageManager.draft = null;\n+            }\n+\n+          }","path":"apps/sms/js/message_manager.js","position":32,"original_position":32,"commit_id":"fe202d1b2bb64262e5c6f3397f43b1378b60a4cb","original_commit_id":"fe202d1b2bb64262e5c6f3397f43b1378b60a4cb","user":{"login":"rwaldron","id":27985,"avatar_url":"https://gravatar.com/avatar/36c697d974542aadaee06a0f39cb1437?d=https%3A%2F%2Fidenticons.github.com%2Fb1a5a84a3388b3f37634445bd1317047.png&r=x","gravatar_id":"36c697d974542aadaee06a0f39cb1437","url":"https://api.github.com/users/rwaldron","html_url":"https://github.com/rwaldron","followers_url":"https://api.github.com/users/rwaldron/followers","following_url":"https://api.github.com/users/rwaldron/following{/other_user}","gists_url":"https://api.github.com/users/rwaldron/gists{/gist_id}","starred_url":"https://api.github.com/users/rwaldron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwaldron/subscriptions","organizations_url":"https://api.github.com/users/rwaldron/orgs","repos_url":"https://api.github.com/users/rwaldron/repos","events_url":"https://api.github.com/users/rwaldron/events{/privacy}","received_events_url":"https://api.github.com/users/rwaldron/received_events","type":"User","site_admin":false},"body":"nit: remove the empty line","created_at":"2014-01-17T19:06:12Z","updated_at":"2014-01-17T19:06:12Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/15374#discussion_r8976358","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/15374","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/8976358"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/15374#discussion_r8976358"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/15374"}}}}